habanalabs/gaudi2: find decode error root cause
Oded Gabbay
maintainerPATCH 1/1 habanalabs/gaudi2: find decode error root cause
From: Koby Elbaz <[email protected]>
When a decode error happens, we often don't know the exact root cause (the erroneous address that was accessed) and the exact engine that created the erroneous transaction.
To find out, we need to go over all the relevant register blocks in the ASIC. Once we find the relevant engine, we print its details and the offending address.
This helps tremendously when debugging an error that was created by running a user workload.
Signed-off-by Koby Elbaz <[email protected]>
Reviewed-by Oded Gabbay <[email protected]>
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/accel/habanalabs/common/habanalabs.h | 10 + drivers/accel/habanalabs/common/security.c | 174 ++++++++++++++++++ drivers/accel/habanalabs/common/security.h | 163 ++++++++++++++++ drivers/accel/habanalabs/gaudi2/gaudi2.c | 155 +++++++++++++++- drivers/accel/habanalabs/gaudi2/gaudi2P.h | 37 ++++ .../include/gaudi2/gaudi2_special_blocks.h | 157 ++++++++++++++++ 6 files changed, 695 insertions(+), 1 deletion(-) create mode 100644 drivers/accel/habanalabs/common/security.h create mode 100644 drivers/accel/habanalabs/include/gaudi2/gaudi2_special_blocks.h
drivers/accel/habanalabs/common/habanalabs.h +10 -0
@@ -29,6 +29,8 @@#include <linux/coresight.h> #include <linux/dma-buf.h> +#include "security.h" +#define HL_NAME "habanalabs"struct hl_device ;
@@ -546,6 +548,8 @@ struct hl_hints_range {/** * struct asic_fixed_properties - ASIC specific immutable properties. * @hw_queues_props: H/W queues properties. +* @special_blocks: points to an array containing special blocks info. +* @skip_special_blocks_cfg: special blocks skip configs. * @cpucp_info: received various information from CPU-CP regarding the H/W, e.g. * available sensors. * @uboot_ver: F/W U-boot version.
@@ -645,6 +649,8 @@ struct hl_hints_range {* (i.e. the DRAM supports multiple page sizes), otherwise * it will shall be equal to dram_page_size. * @num_engine_cores: number of engine cpu cores +* @num_of_special_blocks: special_blocks array size. +* @glbl_err_cause_num: global err cause number. * @hbw_flush_reg: register to read to generate HBW flush. value of 0 means HBW flush is * not supported. * @collective_first_sob: first sync object available for collective use
@@ -695,6 +701,8 @@ struct hl_hints_range {*/ struct asic_fixed_properties {struct hw_queue_properties *hw_queues_props; +struct hl_special_block_info *special_blocks; +struct hl_skip_blocks_cfg skip_special_blocks_cfg;struct cpucp_info cpucp_info;char uboot_ver[VERSION_MAX_LEN ];char preboot_ver[VERSION_MAX_LEN ];
@@ -767,6 +775,8 @@ struct asic_fixed_properties {u32 xbar_edge_enabled_mask;u32 device_mem_alloc_default_page_size;u32 num_engine_cores; +u32 num_of_special_blocks; +u32 glbl_err_cause_num;u32 hbw_flush_reg;u16 collective_first_sob;u16 collective_first_mon;
drivers/accel/habanalabs/common/security.c +174 -0
183 lines not on this page · raw message
drivers/accel/habanalabs/common/security.h new file +163 -0
163 lines not on this page · raw message
drivers/accel/habanalabs/gaudi2/gaudi2.c +154 -1
285 lines not on this page · raw message
drivers/accel/habanalabs/gaudi2/gaudi2P.h +37 -0
@@ -240,6 +240,8 @@#define GAUDI2_SOB_INCREMENT_BY_ONE (FIELD_PREP(DCORE0_SYNC_MNGR_OBJS_SOB_OBJ_VAL_MASK, 1) | \ FIELD_PREP(DCORE0_SYNC_MNGR_OBJS_SOB_OBJ_INC_MASK, 1)) +#define GAUDI2_NUM_OF_GLBL_ERR_CAUSE 8 +enum gaudi2_reserved_sob_id {GAUDI2_RESERVED_SOB_CS_COMPLETION_FIRST , GAUDI2_RESERVED_SOB_CS_COMPLETION_LAST =
@@ -532,6 +534,41 @@ struct gaudi2_device {u32 num_of_valid_hw_events; }; +/* +* Types of the Gaudi2 IP blocks, used by special blocks iterator. +* Required for scenarios where only particular block types can be +* addressed (e.g., special PLDM images). +*/ +enum gaudi2_block_types { +GAUDI2_BLOCK_TYPE_PLL , +GAUDI2_BLOCK_TYPE_RTR , +GAUDI2_BLOCK_TYPE_CPU , +GAUDI2_BLOCK_TYPE_HIF , +GAUDI2_BLOCK_TYPE_HBM , +GAUDI2_BLOCK_TYPE_NIC , +GAUDI2_BLOCK_TYPE_PCIE , +GAUDI2_BLOCK_TYPE_PCIE_PMA , +GAUDI2_BLOCK_TYPE_PDMA , +GAUDI2_BLOCK_TYPE_EDMA , +GAUDI2_BLOCK_TYPE_PMMU , +GAUDI2_BLOCK_TYPE_PSOC , +GAUDI2_BLOCK_TYPE_ROT , +GAUDI2_BLOCK_TYPE_ARC_FARM , +GAUDI2_BLOCK_TYPE_DEC , +GAUDI2_BLOCK_TYPE_MME , +GAUDI2_BLOCK_TYPE_EU_BIST , +GAUDI2_BLOCK_TYPE_SYNC_MNGR , +GAUDI2_BLOCK_TYPE_STLB , +GAUDI2_BLOCK_TYPE_TPC , +GAUDI2_BLOCK_TYPE_HMMU , +GAUDI2_BLOCK_TYPE_SRAM , +GAUDI2_BLOCK_TYPE_XBAR , +GAUDI2_BLOCK_TYPE_KDMA , +GAUDI2_BLOCK_TYPE_XDMA , +GAUDI2_BLOCK_TYPE_XFT , +GAUDI2_BLOCK_TYPE_MAX +}; +extern const u32 gaudi2_dma_core_blocks_bases[DMA_CORE_ID_SIZE ];extern const u32 gaudi2_qm_blocks_bases[GAUDI2_QUEUE_ID_SIZE ];extern const u32 gaudi2_mme_acc_blocks_bases[MME_ID_SIZE ];
drivers/accel/habanalabs/include/gaudi2/gaudi2_special_blocks.h new file +157 -0
157 lines not on this page · raw message
Signature · 1 line
2.25.1