Commit f8bc7f09 authored by Ofir Bitton's avatar Ofir Bitton Committed by Oded Gabbay

habanalabs/gaudi: print sync manager SEI interrupt info

Driver must print sync manager SEI information upon receiving
interrupt from FW.
Signed-off-by: default avatarOfir Bitton <obitton@habana.ai>
Reviewed-by: default avatarOded Gabbay <ogabbay@kernel.org>
Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent 825b30c4
......@@ -225,6 +225,12 @@ gaudi_qman_arb_error_cause[GAUDI_NUM_OF_QM_ARB_ERR_CAUSE] = {
"MSG AXI LBW returned with error"
};
enum gaudi_sm_sei_cause {
GAUDI_SM_SEI_SO_OVERFLOW,
GAUDI_SM_SEI_LBW_4B_UNALIGNED,
GAUDI_SM_SEI_AXI_RESPONSE_ERR
};
static enum hl_queue_type gaudi_queue_type[GAUDI_QUEUE_ID_SIZE] = {
QUEUE_TYPE_EXT, /* GAUDI_QUEUE_ID_DMA_0_0 */
QUEUE_TYPE_EXT, /* GAUDI_QUEUE_ID_DMA_0_1 */
......@@ -6846,6 +6852,34 @@ static void gaudi_handle_qman_err_generic(struct hl_device *hdev,
}
}
static void gaudi_print_sm_sei_info(struct hl_device *hdev, u16 event_type,
struct hl_eq_sm_sei_data *sei_data)
{
u32 index = event_type - GAUDI_EVENT_DMA_IF_SEI_0;
switch (sei_data->sei_cause) {
case GAUDI_SM_SEI_SO_OVERFLOW:
dev_err(hdev->dev,
"SM %u SEI Error: SO %u overflow/underflow",
index, le16_to_cpu(sei_data->sei_log));
break;
case GAUDI_SM_SEI_LBW_4B_UNALIGNED:
dev_err(hdev->dev,
"SM %u SEI Error: Unaligned 4B LBW access, monitor agent address low - %#x",
index, le16_to_cpu(sei_data->sei_log));
break;
case GAUDI_SM_SEI_AXI_RESPONSE_ERR:
dev_err(hdev->dev,
"SM %u SEI Error: AXI ID %u response error",
index, le16_to_cpu(sei_data->sei_log));
break;
default:
dev_err(hdev->dev, "Unknown SM SEI cause %u",
le16_to_cpu(sei_data->sei_log));
break;
}
}
static void gaudi_handle_ecc_event(struct hl_device *hdev, u16 event_type,
struct hl_eq_ecc_data *ecc_data)
{
......@@ -7469,6 +7503,13 @@ static void gaudi_handle_eqe(struct hl_device *hdev,
hl_fw_unmask_irq(hdev, event_type);
break;
case GAUDI_EVENT_DMA_IF_SEI_0 ... GAUDI_EVENT_DMA_IF_SEI_3:
gaudi_print_irq_info(hdev, event_type, false);
gaudi_print_sm_sei_info(hdev, event_type,
&eq_entry->sm_sei_data);
hl_fw_unmask_irq(hdev, event_type);
break;
case GAUDI_EVENT_FIX_POWER_ENV_S ... GAUDI_EVENT_FIX_THERMAL_ENV_E:
gaudi_print_clk_change_info(hdev, event_type);
hl_fw_unmask_irq(hdev, event_type);
......
......@@ -58,11 +58,18 @@ struct hl_eq_ecc_data {
__u8 pad[7];
};
struct hl_eq_sm_sei_data {
__le16 sei_log;
__u8 sei_cause;
__u8 pad[5];
};
struct hl_eq_entry {
struct hl_eq_header hdr;
union {
struct hl_eq_ecc_data ecc_data;
struct hl_eq_hbm_ecc_data hbm_ecc_data;
struct hl_eq_sm_sei_data sm_sei_data;
__le64 data[7];
};
};
......
......@@ -212,6 +212,10 @@ enum gaudi_async_event_id {
GAUDI_EVENT_NIC_SEI_2 = 266,
GAUDI_EVENT_NIC_SEI_3 = 267,
GAUDI_EVENT_NIC_SEI_4 = 268,
GAUDI_EVENT_DMA_IF_SEI_0 = 277,
GAUDI_EVENT_DMA_IF_SEI_1 = 278,
GAUDI_EVENT_DMA_IF_SEI_2 = 279,
GAUDI_EVENT_DMA_IF_SEI_3 = 280,
GAUDI_EVENT_PCIE_FLR = 290,
GAUDI_EVENT_TPC0_BMON_SPMU = 300,
GAUDI_EVENT_TPC0_KRN_ERR = 301,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment