habanalabs: update SyncManager interrupt handling
PATCH 1/3 habanalabs: update SyncManager interrupt handling
The firmware provides more information about SyncManager events. Adjust the code to the latest firmware interface file.
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/misc/habanalabs/gaudi/gaudi.c | 14 +++++++------- drivers/misc/habanalabs/include/common/cpucp_if.h | 11 +++++++++-- 2 files changed, 16 insertions(+), 9 deletions(-)
drivers/misc/habanalabs/gaudi/gaudi.c +7 -7
@@ -6860,24 +6860,24 @@ static void gaudi_print_sm_sei_info(struct hl_device *hdev, u16 event_type,u32 index = event_type -GAUDI_EVENT_DMA_IF_SEI_0 ;switch (sei_data->sei_cause) { -case GAUDI_SM_SEI_SO_OVERFLOW : +case SM_SEI_SO_OVERFLOW :dev_err (hdev->dev,"SM %u SEI Error: SO %u overflow/underflow" , - index,le16_to_cpu (sei_data->sei_log)); + index,le32_to_cpu (sei_data->sei_log));break ; -case GAUDI_SM_SEI_LBW_4B_UNALIGNED : +case 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)); + index,le32_to_cpu (sei_data->sei_log));break ; -case GAUDI_SM_SEI_AXI_RESPONSE_ERR : +case 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)); + index,le32_to_cpu (sei_data->sei_log));break ;default :dev_err (hdev->dev,"Unknown SM SEI cause %u" , -le16_to_cpu (sei_data->sei_log)); +le32_to_cpu (sei_data->sei_log));break ; } }
drivers/misc/habanalabs/include/common/cpucp_if.h +9 -2
@@ -58,10 +58,17 @@ struct hl_eq_ecc_data {__u8 pad[7 ]; }; +enum hl_sm_sei_cause { +SM_SEI_SO_OVERFLOW , +SM_SEI_LBW_4B_UNALIGNED , +SM_SEI_AXI_RESPONSE_ERR +}; +struct hl_eq_sm_sei_data { -__le16 sei_log; +__le32 sei_log; +/* enum hl_sm_sei_cause */ __u8 sei_cause; -__u8 pad[5 ]; +__u8 pad[3 ]; };struct hl_eq_entry {
Signature · 1 line
2.25.1
PATCH 2/3 habanalabs/gaudi: unmask HBM interrupts after handling
As the driver does with all interrupts, we need to tell F/W to unmask the HBM interrupts after the driver handled them.
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/misc/habanalabs/gaudi/gaudi.c | 1 + 1 file changed, 1 insertion(+)
drivers/misc/habanalabs/gaudi/gaudi.c +1 -0
@@ -7377,6 +7377,7 @@ static void gaudi_handle_eqe(struct hl_device *hdev,gaudi_hbm_read_interrupts (hdev,gaudi_hbm_event_to_dev (event_type), &eq_entry->hbm_ecc_data); +hl_fw_unmask_irq (hdev, event_type);break ;case GAUDI_EVENT_TPC0_DEC :
Signature · 1 line
2.25.1
PATCH 3/3 habanalabs: update to latest hl_boot_if.h spec from F/W
In reply to Oded GabbayIt adds the definition for indication that the F/W handles HBM ECC events.
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/misc/habanalabs/include/common/hl_boot_if.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/misc/habanalabs/include/common/hl_boot_if.h +7 -1
@@ -69,8 +69,9 @@* image has failed to match expected * checksum. Trying to program image again * might solve this. +* * CPU_BOOT_ERR0_PLL_FAIL PLL settings failed, meaning that one -* of the PLLs remained in REF_CLK +* of the PLLs remains in REF_CLK * * CPU_BOOT_ERR0_ENABLED Error registers enabled. * This is a main indication that the
@@ -161,6 +162,10 @@* FW initialized Clock Gating. * Initialized in: preboot * +* CPU_BOOT_DEV_STS0_HBM_ECC_EN HBM ECC handling Enabled. +* FW handles HBM ECC indications. +* Initialized in: linux +* * CPU_BOOT_DEV_STS0_ENABLED Device status register enabled. * This is a main indication that the * running FW populates the device status
@@ -184,6 +189,7 @@#define CPU_BOOT_DEV_STS0_PLL_INFO_EN (1 << 11)#define CPU_BOOT_DEV_STS0_SP_SRAM_EN (1 << 12)#define CPU_BOOT_DEV_STS0_CLK_GATE_EN (1 << 13) +#define CPU_BOOT_DEV_STS0_HBM_ECC_EN (1 << 14)#define CPU_BOOT_DEV_STS0_ENABLED (1 << 31)enum cpu_boot_status {
Signature · 1 line
2.25.1