*Supporting RAS on XE
Subsystems (3)
v8 cover *Supporting RAS on XE
Our platforms support Reliability, Availability and Serviceability(RAS). In case of hardware errors, our hardwares provides the causes via sending interrupt or pcie errors. The fatal errors are propogated as pci errors and non fatal errors as MSI. This series focuses on loging and updating counters for these errors, which will be helpful to avoid, detect and repair hardware faults.
This [1] series proposes mechanism to expose this counters to userspace. [1]: https://patchwork.freedesktop.org/series/118435/
The error counters exposed by KMD will be used by L0/sysman They will be categorized to specific category of error in sysman:
https://spec.oneapi.io/level-zero/latest/sysman/api.html#ras
We have very limited capabilities for error injection to validate the
code flow.
Output of L3 fabric fatal injection from PVC is:
xe 0000:8c:00.0: [drm] *ERROR* [Hardware Error]: TILE0 detected GT FATAL error bit[0] is set
xe 0000:8c:00.0: [drm] *ERROR* [Hardware Error]: GT0 detected L3 FABRIC FATAL error. ERR_VECT_GT_FATAL[7]:0x00000087
v2
- Use different headers for error registers. (Nikula)
- Correctable errors shouldn't be considered as dmesg errors (Matt)
- Limit series to HW errors.(Aravind)
v3
- Rebase
v4
- Use xe_regs.h only for registers, move enums out of it.
- Make sure global data/structures are immutable.
- Avoid adding custom error logging macro's.
- Redesign the registers error name and counter index structures for maintainability. (Nikula)
v5
- move struct hw_err_regs out of CONFIG_DRM_XE_DISPLAY.
v6
- Addressing Review comments from Aravind.
v7
- CI fixes.
v8
- Conditional check fixes.
Himal Prasad Ghimiray (4):
drm/xe: Handle errors from various components. drm/xe: Log and count the GT hardware errors. drm/xe: Support GT hardware error reporting for PVC. drm/xe: Support GSC hardware error reporting for PVC. drm/xe: Notify userspace about GSC HW errors. drm/xe: Support SOC FATAL error handling for PVC. drm/xe: Support SOC NONFATAL error handling for PVC. drm/xe: Handle MDFI error severity.
drm/xe: Clear SOC CORRECTABLE error registers. drm/xe: Clear all SoC errors post warm reset.
drivers/gpu/drm/xe/Makefile | 1 + drivers/gpu/drm/xe/regs/xe_gt_error_regs.h | 29 + drivers/gpu/drm/xe/regs/xe_regs.h | 5 +- drivers/gpu/drm/xe/regs/xe_tile_error_regs.h | 65 ++ drivers/gpu/drm/xe/xe_device.c | 14 + drivers/gpu/drm/xe/xe_device_types.h | 21 + drivers/gpu/drm/xe/xe_gt.c | 1 + drivers/gpu/drm/xe/xe_gt_types.h | 7 + drivers/gpu/drm/xe/xe_hw_error.c | 919 +++++++++++++++++++ drivers/gpu/drm/xe/xe_hw_error.h | 210 +++++ drivers/gpu/drm/xe/xe_irq.c | 9 + drivers/gpu/drm/xe/xe_tile.c | 1 + include/uapi/drm/xe_drm.h | 8 + 13 files changed, 1289 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/xe/regs/xe_gt_error_regs.h create mode 100644 drivers/gpu/drm/xe/regs/xe_tile_error_regs.h create mode 100644 drivers/gpu/drm/xe/xe_hw_error.c create mode 100644 drivers/gpu/drm/xe/xe_hw_error.h
Signature · 1 line
2.25.1
PATCH v8 1/10 drm/xe: Handle errors from various components.
The GFX device reports two classes of errors: uncorrectable and correctable. Depending on the severity uncorrectable errors are further classified as non fatal and fatal. Driver will only handle logging of errors and updating counters from various components within the graphics device. Anything more will be handled at system level.
Correctable and NonFatal errors are reported as interrupts, bits in the Master Interrupt Register will be used to convey the class of error. Determine source of error (IP block) by reading the Device Error Source Register (RW1C) that corresponds to the class of error being serviced
Fatal errors are reported as PCIe errors. When a PCIe error is asserted, the OS will perform a device warm reset which causes the driver to reload. The error registers are sticky and the values are maintained through a warm reset. We read these registers during the boot flow of the driver and increment the respective error counters.
Bspec: 50875, 53073, 53074, 53075, 53076
v6
- Limit the implementation to DG2 and PVC.
- Limit the tile level logging to only PVC.
- Use xarray instead of array for error counters.
- Squash the fatal error reporting patch with this patch.
- use drm_dbg instead of drm_info to dump register values.
- use XE_HW_ERR_UNSPEC for error which are reported by leaf registers.
- use source_typeoferror_errorname convention for enum and error loging.
- Clean unused enums and there are no display supported ras error, categorize them as unknown.
- Dont make xe_assign_hw_err_regs static.
- Use err_name_index_pair instead of err_msg_cntr_pair.(Aravind)
v7
- Ci fix
v8
- Avoid unnecessary write if reg is empty incase of DG2.
--- drivers/gpu/drm/xe/Makefile | 1 + drivers/gpu/drm/xe/regs/xe_regs.h | 5 +- drivers/gpu/drm/xe/regs/xe_tile_error_regs.h | 15 ++ drivers/gpu/drm/xe/xe_device.c | 10 + drivers/gpu/drm/xe/xe_device_types.h | 11 + drivers/gpu/drm/xe/xe_hw_error.c | 262 +++++++++++++++++++ drivers/gpu/drm/xe/xe_hw_error.h | 53 ++++ drivers/gpu/drm/xe/xe_irq.c | 4 + drivers/gpu/drm/xe/xe_tile.c | 1 + 9 files changed, 361 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/xe/regs/xe_tile_error_regs.h create mode 100644 drivers/gpu/drm/xe/xe_hw_error.c create mode 100644 drivers/gpu/drm/xe/xe_hw_error.h
drivers/gpu/drm/xe/Makefile +1 -0
@@ -77,6 +77,7 @@ xe-y += xe_bb.o \ xe_heci_gsc.o \ xe_hw_engine.o \ xe_hw_engine_class_sysfs.o \ + xe_hw_error.o \ xe_hw_fence.o \ xe_huc.o \ xe_huc_debugfs.o \
drivers/gpu/drm/xe/regs/xe_regs.h +4 -1
@@ -57,6 +57,9 @@#define SOFTWARE_FLAGS_SPR33 XE_REG(0x4f084) +#define DEV_PCIEERR_STATUS XE_REG(0x100180) +#define DEV_PCIEERR_IS_FATAL (x) REG_BIT(x * 4 + 2) +#define GU_CNTL XE_REG(0x101010)#define LMEM_INIT REG_BIT(7)
@@ -95,7 +98,7 @@#define GU_MISC_IRQ REG_BIT(29)#define DISPLAY_IRQ REG_BIT(16)#define GT_DW_IRQ (x) REG_BIT(x) +#define XE_ERROR_IRQ (x) REG_BIT(26 + (x))#define PVC_RP_STATE_CAP XE_REG(0x281014) -#endif
drivers/gpu/drm/xe/regs/xe_tile_error_regs.h new file +15 -0
@@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2023 Intel Corporation +*/ +#ifndef XE_TILE_ERROR_REGS_H_ +#define XE_TILE_ERROR_REGS_H_ + +#include <linux/stddef.h> + +#define _DEV_ERR_STAT_NONFATAL 0x100178 +#define _DEV_ERR_STAT_CORRECTABLE 0x10017c +#define DEV_ERR_STAT_REG (x) XE_REG(_PICK_EVEN((x), \ + _DEV_ERR_STAT_CORRECTABLE, \ + _DEV_ERR_STAT_NONFATAL)) +#endif
drivers/gpu/drm/xe/xe_device.c +10 -0
@@ -388,8 +388,18 @@ static void xe_device_remove_display(struct xe_device *xe)xe_display_driver_remove (xe); } +static void xe_hw_error_fini (struct xe_device *xe) +{ +struct xe_tile *tile; +int i; + +for_each_tile (tile, xe, i) +xa_destroy (&tile->errors.hw_error); +} +void xe_device_remove (struct xe_device *xe) { +xe_hw_error_fini (xe);xe_device_remove_display (xe);xe_display_fini (xe);
drivers/gpu/drm/xe/xe_device_types.h +11 -0
@@ -15,6 +15,7 @@#include "xe_devcoredump_types.h" #include "xe_heci_gsc.h" #include "xe_gt_types.h" +#include "xe_hw_error.h" #include "xe_platform_types.h" #include "xe_pt_types.h" #include "xe_pmu.h"
@@ -190,6 +191,11 @@ struct xe_tile {/** @sysfs: sysfs' kobj used by xe_tile_sysfs */ struct kobject *sysfs; + +/** @errors: hardware errors reported for the tile */ +struct tile_hw_errors { +struct xarray hw_error; + } errors; };/**
@@ -405,6 +411,11 @@ struct xe_device {/** @heci_gsc: graphics security controller */ struct xe_heci_gsc heci_gsc; +/** @hw_err_regs: list of hw error regs*/ +struct hardware_errors_regs { +const struct err_name_index_pair *dev_err_stat[HARDWARE_ERROR_MAX ]; + } hw_err_regs; +/* private: */ #if IS_ENABLED (CONFIG_DRM_XE_DISPLAY )
drivers/gpu/drm/xe/xe_hw_error.c new file +262 -0
262 lines not on this page · raw message
drivers/gpu/drm/xe/xe_hw_error.h new file +53 -0
53 lines not on this page · raw message
drivers/gpu/drm/xe/xe_irq.c +4 -0
@@ -444,6 +444,7 @@ static irqreturn_t dg1_irq_handler(int irq, void *arg)xe_mmio_write32 (mmio,GFX_MSTR_IRQ , master_ctl);gt_irq_handler (tile, master_ctl, intr_dw, identity); +xe_hw_error_irq_handler (tile, master_ctl);/* * Display interrupts (including display backlight operations
@@ -619,6 +620,9 @@ int xe_irq_install(struct xe_device *xe)return -EINVAL ; } +xe_assign_hw_err_regs (xe); +xe_process_hw_errors (xe); +xe_irq_reset (xe); err =pci_alloc_irq_vectors (pdev,1 ,1 ,PCI_IRQ_MSI |PCI_IRQ_MSIX );
drivers/gpu/drm/xe/xe_tile.c +1 -0
@@ -130,6 +130,7 @@ int xe_tile_init_noalloc(struct xe_tile *tile) {int err; +xa_init (&tile->errors.hw_error);xe_device_mem_access_get (tile_to_xe (tile)); err =tile_ttm_mgr_init (tile);
Signature · 1 line
2.25.1
PATCH v7 2/10 drm/xe: Log and count the GT hardware errors.
In reply to Himal Prasad GhimirayFor the errors reported by GT unit, read the GT error register. Log and count these errors and clear the error register.
Bspec: 53088, 53089, 53090
v6
- define the BIT and use it.
- Limit the GT error reporting to DG2 and PVC only.
- Rename function to xe_gt_hw_error_log_status_reg from xe_gt_hw_error_status_reg_handler. (Aravind)
v7
- ci fixes
--- drivers/gpu/drm/xe/regs/xe_gt_error_regs.h | 13 +++ drivers/gpu/drm/xe/regs/xe_tile_error_regs.h | 1 + drivers/gpu/drm/xe/xe_device.c | 4 + drivers/gpu/drm/xe/xe_device_types.h | 1 + drivers/gpu/drm/xe/xe_gt.c | 1 + drivers/gpu/drm/xe/xe_gt_types.h | 7 ++ drivers/gpu/drm/xe/xe_hw_error.c | 97 +++++++++++++++++++- drivers/gpu/drm/xe/xe_hw_error.h | 24 +++++ 8 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/xe/regs/xe_gt_error_regs.h
drivers/gpu/drm/xe/regs/xe_gt_error_regs.h new file +13 -0
@@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2023 Intel Corporation +*/ +#ifndef XE_GT_ERROR_REGS_H_ +#define XE_GT_ERROR_REGS_H_ + +#define _ERR_STAT_GT_COR 0x100160 +#define _ERR_STAT_GT_NONFATAL 0x100164 +#define ERR_STAT_GT_REG (x) XE_REG(_PICK_EVEN((x), \ + _ERR_STAT_GT_COR, \ + _ERR_STAT_GT_NONFATAL)) +#endif
drivers/gpu/drm/xe/regs/xe_tile_error_regs.h +1 -0
@@ -12,4 +12,5 @@#define DEV_ERR_STAT_REG (x) XE_REG(_PICK_EVEN((x), \ _DEV_ERR_STAT_CORRECTABLE, \ _DEV_ERR_STAT_NONFATAL)) +#define XE_GT_ERROR 0#endif
drivers/gpu/drm/xe/xe_device.c +4 -0
@@ -391,10 +391,14 @@ static void xe_device_remove_display(struct xe_device *xe)static void xe_hw_error_fini (struct xe_device *xe) {struct xe_tile *tile; +struct xe_gt *gt;int i;for_each_tile (tile, xe, i)xa_destroy (&tile->errors.hw_error); + +for_each_gt (gt, xe, i) +xa_destroy (>->errors.hw_error); }void xe_device_remove (struct xe_device *xe)
drivers/gpu/drm/xe/xe_device_types.h +1 -0
@@ -414,6 +414,7 @@ struct xe_device {/** @hw_err_regs: list of hw error regs*/ struct hardware_errors_regs {const struct err_name_index_pair *dev_err_stat[HARDWARE_ERROR_MAX ]; +const struct err_name_index_pair *err_stat_gt[HARDWARE_ERROR_MAX ]; } hw_err_regs;/* private: */
drivers/gpu/drm/xe/xe_gt.c +1 -0
@@ -282,6 +282,7 @@ int xe_gt_init_early(struct xe_gt *gt) {int err; +xa_init (>->errors.hw_error);xe_force_wake_init_gt (gt,gt_to_fw (gt)); err =xe_force_wake_get (gt_to_fw (gt),XE_FW_GT );
drivers/gpu/drm/xe/xe_gt_types.h +7 -0
@@ -9,10 +9,12 @@#include "xe_force_wake_types.h" #include "xe_gt_idle_sysfs_types.h" #include "xe_hw_engine_types.h" +#include "xe_hw_error.h" #include "xe_hw_fence_types.h" #include "xe_reg_sr_types.h" #include "xe_sa_types.h" #include "xe_uc_types.h" +#include "regs/xe_gt_error_regs.h" struct xe_exec_queue_ops ;struct xe_migrate ;
@@ -347,6 +349,11 @@ struct xe_gt {/** @oob: bitmap with active OOB workaroudns */ unsigned long *oob; } wa_active; + +/** @errors: hardware errors reported for the gt */ +struct gt_hw_errors { +struct xarray hw_error; + } errors; };#endif
drivers/gpu/drm/xe/xe_hw_error.c +96 -1
131 lines not on this page · raw message
drivers/gpu/drm/xe/xe_hw_error.h +24 -0
@@ -38,6 +38,30 @@ enum xe_tile_hw_errors { XE_HW_ERROR_TILE_MAX, }; +/* Count of GT Correctable and FATAL HW ERRORS */ +enum xe_gt_hw_errors { +XE_HW_ERR_GT_CORR_L3_SNG , +XE_HW_ERR_GT_CORR_GUC , +XE_HW_ERR_GT_CORR_SAMPLER , +XE_HW_ERR_GT_CORR_SLM , +XE_HW_ERR_GT_CORR_EU_IC , +XE_HW_ERR_GT_CORR_EU_GRF , +XE_HW_ERR_GT_CORR_UNKNOWN , +XE_HW_ERR_GT_FATAL_ARR_BIST , +XE_HW_ERR_GT_FATAL_FPU , +XE_HW_ERR_GT_FATAL_L3_DOUB , +XE_HW_ERR_GT_FATAL_L3_ECC_CHK , +XE_HW_ERR_GT_FATAL_GUC , +XE_HW_ERR_GT_FATAL_IDI_PAR , +XE_HW_ERR_GT_FATAL_SQIDI , +XE_HW_ERR_GT_FATAL_SAMPLER , +XE_HW_ERR_GT_FATAL_SLM , +XE_HW_ERR_GT_FATAL_EU_IC , +XE_HW_ERR_GT_FATAL_EU_GRF , +XE_HW_ERR_GT_FATAL_UNKNOWN , +XE_HW_ERR_GT_MAX , +}; +struct err_name_index_pair {const char *name;const u32 index;
Signature · 1 line
2.25.1
PATCH v6 3/10 drm/xe: Support GT hardware error reporting for PVC.
In reply to Himal Prasad GhimirayPVC supports GT error reporting via vector registers alongwith error status register. Add support to report these errors and update respective counters.
Incase of Subslice error reported by vector register, process the error status register for applicable bits.
Bspec: 54179, 54177, 53088, 53089
v6
- Define registers ascending order of their addresses.
- use xe_gt_hw_error_log_vector_reg instead of xe_gt_hw_error_vectr_reg_handler.
- use xe_assign_hw_err_regs for reg initialization.
- use switch-case instead of if-else.
--- drivers/gpu/drm/xe/regs/xe_gt_error_regs.h | 16 +++ drivers/gpu/drm/xe/xe_device_types.h | 1 + drivers/gpu/drm/xe/xe_hw_error.c | 127 ++++++++++++++++++++- drivers/gpu/drm/xe/xe_hw_error.h | 20 ++++ 4 files changed, 162 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/regs/xe_gt_error_regs.h +16 -0
@@ -10,4 +10,20 @@#define ERR_STAT_GT_REG (x) XE_REG(_PICK_EVEN((x), \ _ERR_STAT_GT_COR, \ _ERR_STAT_GT_NONFATAL)) + +#define _ERR_STAT_GT_FATAL_VCTR_0 0x100260 +#define _ERR_STAT_GT_FATAL_VCTR_1 0x100264 +#define ERR_STAT_GT_FATAL_VCTR_REG (x) XE_REG(_PICK_EVEN((x), \ + _ERR_STAT_GT_FATAL_VCTR_0, \ + _ERR_STAT_GT_FATAL_VCTR_1)) + +#define _ERR_STAT_GT_COR_VCTR_0 0x1002a0 +#define _ERR_STAT_GT_COR_VCTR_1 0x1002a4 +#define ERR_STAT_GT_COR_VCTR_REG (x) XE_REG(_PICK_EVEN((x), \ + _ERR_STAT_GT_COR_VCTR_0, \ + _ERR_STAT_GT_COR_VCTR_1)) + +#define ERR_STAT_GT_VCTR_REG (hw_err, x) (hw_err == HARDWARE_ERROR_CORRECTABLE ? \ + ERR_STAT_GT_COR_VCTR_REG(x) : \ + ERR_STAT_GT_FATAL_VCTR_REG(x))#endif
drivers/gpu/drm/xe/xe_device_types.h +1 -0
@@ -415,6 +415,7 @@ struct xe_device {struct hardware_errors_regs {const struct err_name_index_pair *dev_err_stat[HARDWARE_ERROR_MAX ];const struct err_name_index_pair *err_stat_gt[HARDWARE_ERROR_MAX ]; +const struct err_name_index_pair *err_vctr_gt[HARDWARE_ERROR_MAX ]; } hw_err_regs;/* private: */
drivers/gpu/drm/xe/xe_hw_error.c +125 -2
178 lines not on this page · raw message
drivers/gpu/drm/xe/xe_hw_error.h +20 -0
@@ -10,6 +10,9 @@#define XE_RAS_REG_SIZE 32 +#define ERR_STAT_GT_COR_VCTR_LEN (4) +#define ERR_STAT_GT_FATAL_VCTR_LEN (8) +/* Error categories reported by hardware */ enum hardware_error {HARDWARE_ERROR_CORRECTABLE =0 ,
@@ -38,8 +41,21 @@ enum xe_tile_hw_errors { XE_HW_ERROR_TILE_MAX, }; +enum gt_vctr_registers { +ERR_STAT_GT_VCTR0 =0 , +ERR_STAT_GT_VCTR1 , +ERR_STAT_GT_VCTR2 , +ERR_STAT_GT_VCTR3 , +ERR_STAT_GT_VCTR4 , +ERR_STAT_GT_VCTR5 , +ERR_STAT_GT_VCTR6 , +ERR_STAT_GT_VCTR7 , +}; +/* Count of GT Correctable and FATAL HW ERRORS */ enum xe_gt_hw_errors { +XE_HW_ERR_GT_CORR_SUBSLICE , +XE_HW_ERR_GT_CORR_L3BANK ,XE_HW_ERR_GT_CORR_L3_SNG ,XE_HW_ERR_GT_CORR_GUC ,XE_HW_ERR_GT_CORR_SAMPLER ,
@@ -47,6 +63,10 @@ enum xe_gt_hw_errors {XE_HW_ERR_GT_CORR_EU_IC ,XE_HW_ERR_GT_CORR_EU_GRF ,XE_HW_ERR_GT_CORR_UNKNOWN , +XE_HW_ERR_GT_FATAL_SUBSLICE , +XE_HW_ERR_GT_FATAL_L3BANK , +XE_HW_ERR_GT_FATAL_TLB , +XE_HW_ERR_GT_FATAL_L3_FABRIC ,XE_HW_ERR_GT_FATAL_ARR_BIST ,XE_HW_ERR_GT_FATAL_FPU , XE_HW_ERR_GT_FATAL_L3_DOUB,
Signature · 1 line
2.25.1
PATCH v2 2/10 drm/xe: Clear SOC CORRECTABLE error registers.
In reply to Himal Prasad GhimirayPVC doesn't support correctable SOC error reporting, classify them as Undefined and clear the registers.
v2
- Fix commit message.
- Although the errors are correctable but they are spurious interrupt. Hence use drm_err instead of drm_warn.(Aravind)
--- drivers/gpu/drm/xe/xe_hw_error.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_hw_error.c +21 -2
@@ -646,8 +646,26 @@ xe_soc_hw_error_handler(struct xe_tile *tile, const enum hardware_error hw_err)if (tile_to_xe (tile)->info.platform !=XE_PVC )return ; -if (hw_err ==HARDWARE_ERROR_CORRECTABLE ) -return ; +if (hw_err ==HARDWARE_ERROR_CORRECTABLE ) { +for (i =0 ; i <XE_SOC_NUM_IEH ; i++) +xe_mmio_write32 (gt,SOC_GSYSEVTCTL_REG (base, slave_base, i), + ~REG_BIT (hw_err)); + +xe_mmio_write32 (gt,SOC_GLOBAL_ERR_STAT_MASTER_REG (base, hw_err), +REG_GENMASK (31 ,0 )); +xe_mmio_write32 (gt,SOC_LOCAL_ERR_STAT_MASTER_REG (base, hw_err), +REG_GENMASK (31 ,0 )); +xe_mmio_write32 (gt,SOC_GLOBAL_ERR_STAT_SLAVE_REG (slave_base, hw_err), +REG_GENMASK (31 ,0 )); +xe_mmio_write32 (gt,SOC_LOCAL_ERR_STAT_SLAVE_REG (slave_base, hw_err), +REG_GENMASK (31 ,0 )); + +drm_err (&tile_to_xe (tile)->drm,HW_ERR +"Tile%d reported Undefine SOC CORRECTABLE error." , + tile->id); + + goto unmask_gsysevtctl; + } base =SOC_PVC_BASE ; slave_base =SOC_PVC_SLAVE_BASE ;
@@ -729,6 +747,7 @@ xe_soc_hw_error_handler(struct xe_tile *tile, const enum hardware_error hw_err)xe_mmio_write32 (gt,SOC_GLOBAL_ERR_STAT_MASTER_REG (base, hw_err), mst_glb_errstat); +unmask_gsysevtctl:for (i =0 ; i <XE_SOC_NUM_IEH ; i++)xe_mmio_write32 (gt,SOC_GSYSEVTCTL_REG (base, slave_base, i), (HARDWARE_ERROR_MAX <<1 ) +1 );
Signature · 1 line
2.25.1
PATCH v2 4/10 drm/xe: Support GSC hardware error reporting for PVC.
In reply to Himal Prasad GhimirayAdd support to report GSC hw errors and counter update in case of correctable errors.
v2
- skip FW_ERR reporting via counters.
- maintain uniform naming for enums.
- Use same convention for error reporting.(Aravind)
--- drivers/gpu/drm/xe/regs/xe_tile_error_regs.h | 9 ++ drivers/gpu/drm/xe/xe_device_types.h | 1 + drivers/gpu/drm/xe/xe_hw_error.c | 96 ++++++++++++++++++++ drivers/gpu/drm/xe/xe_hw_error.h | 19 +++- 4 files changed, 124 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/regs/xe_tile_error_regs.h +9 -0
@@ -7,10 +7,19 @@#include <linux/stddef.h> +#define _GSC_HEC_UNCOR_ERR_STATUS 0x118 +#define _GSC_HEC_CORR_ERR_STATUS 0x128 +#define GSC_HEC_ERR_STAT_REG (base, x) XE_REG(_PICK_EVEN((x), \ + (base) + _GSC_HEC_CORR_ERR_STATUS, \ + (base) + _GSC_HEC_UNCOR_ERR_STATUS)) +#define _DEV_ERR_STAT_NONFATAL 0x100178#define _DEV_ERR_STAT_CORRECTABLE 0x10017c#define DEV_ERR_STAT_REG (x) XE_REG(_PICK_EVEN((x), \ _DEV_ERR_STAT_CORRECTABLE, \ _DEV_ERR_STAT_NONFATAL))#define XE_GT_ERROR 0 +#define XE_GSC_ERROR 8 + +#define PVC_GSC_HECI1_BASE 0x284000#endif
drivers/gpu/drm/xe/xe_device_types.h +1 -0
@@ -416,6 +416,7 @@ struct xe_device {const struct err_name_index_pair *dev_err_stat[HARDWARE_ERROR_MAX ];const struct err_name_index_pair *err_stat_gt[HARDWARE_ERROR_MAX ];const struct err_name_index_pair *err_vctr_gt[HARDWARE_ERROR_MAX ]; +const struct err_name_index_pair *gsc_error[HARDWARE_ERROR_MAX ]; } hw_err_regs;/* private: */
drivers/gpu/drm/xe/xe_hw_error.c +96 -0
128 lines not on this page · raw message
drivers/gpu/drm/xe/xe_hw_error.h +18 -1
@@ -38,7 +38,24 @@ enum xe_tile_hw_errors {XE_HW_ERR_TILE_CORR_SGUNIT ,XE_HW_ERR_TILE_CORR_UNKNOWN , XE_HW_ERR_TILE_UNSPEC, - XE_HW_ERROR_TILE_MAX, +}; + +enum xe_gsc_hw_errors { +XE_HW_ERR_GSC_CORR_SRAM =XE_HW_ERR_TILE_UNSPEC +1 , +XE_HW_ERR_GSC_CORR_UNKNOWN , +XE_HW_ERR_GSC_NONFATAL_MIA_SHUTDOWN , +XE_HW_ERR_GSC_NONFATAL_MIA_INTERNAL , +XE_HW_ERR_GSC_NONFATAL_SRAM , +XE_HW_ERR_GSC_NONFATAL_WDG , +XE_HW_ERR_GSC_NONFATAL_ROM_PARITY , +XE_HW_ERR_GSC_NONFATAL_UCODE_PARITY , +XE_HW_ERR_GSC_NONFATAL_VLT_GLITCH , +XE_HW_ERR_GSC_NONFATAL_FUSE_PULL , +XE_HW_ERR_GSC_NONFATAL_FUSE_CRC , +XE_HW_ERR_GSC_NONFATAL_SELF_MBIST , +XE_HW_ERR_GSC_NONFATAL_AON_RF_PARITY , +XE_HW_ERR_GSC_NONFATAL_UNKNOWN , +XE_HW_ERROR_TILE_MAX }; enum gt_vctr_registers {
Signature · 1 line
2.25.1
PATCH v3 6/10 drm/xe: Support SOC FATAL error handling for PVC.
In reply to Himal Prasad GhimirayReport the SOC fatal hardware error and update the counters which will increment incase of error.
v2
- Use xe_assign_hw_err_regs to initilaize registers.
- Use separate enums for SOC errors.
- Use xarray.
- No need to prepend register offsets with 0's.
- Dont use the counters if error is being reported by second level registers.
- Fix Num of IEH to 2.
- define the bits along with respective register and use.
- Follow the convention source_typeoferror_errorname for enum and error reporting.(Aravind)
v3
- Fix the condition check.
--- drivers/gpu/drm/xe/regs/xe_tile_error_regs.h | 31 +++ drivers/gpu/drm/xe/xe_device_types.h | 4 + drivers/gpu/drm/xe/xe_hw_error.c | 188 +++++++++++++++++++ drivers/gpu/drm/xe/xe_hw_error.h | 59 +++++- 4 files changed, 280 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/regs/xe_tile_error_regs.h +31 -0
@@ -12,6 +12,33 @@#define GSC_HEC_ERR_STAT_REG (base, x) XE_REG(_PICK_EVEN((x), \ (base) + _GSC_HEC_CORR_ERR_STATUS, \ (base) + _GSC_HEC_UNCOR_ERR_STATUS)) +#define _SOC_GCOERRSTS 0x200 +#define _SOC_GNFERRSTS 0x210 +#define _SOC_GFAERRSTS 0x220 +#define SOC_GLOBAL_ERR_STAT_SLAVE_REG (base, x) XE_REG(_PICK_EVEN((x), \ + (base) + _SOC_GCOERRSTS, \ + (base) + _SOC_GNFERRSTS)) +#define SOC_IEH1_LOCAL_ERR_STATUS 0 + +#define SOC_GLOBAL_ERR_STAT_MASTER_REG (base, x) XE_REG(_PICK_EVEN((x), \ + (base) + _SOC_GCOERRSTS, \ + (base) + _SOC_GNFERRSTS)) +#define SOC_IEH0_LOCAL_ERR_STATUS 0 + +#define _SOC_GSYSEVTCTL 0x264 +#define SOC_GSYSEVTCTL_REG (base, slave_base, x) XE_REG(_PICK_EVEN((x), \ + (base) + _SOC_GSYSEVTCTL, \ + slave_base + _SOC_GSYSEVTCTL)) + +#define _SOC_LERRCORSTS 0x294 +#define _SOC_LERRUNCSTS 0x280 +#define SOC_LOCAL_ERR_STAT_SLAVE_REG (base, x) XE_REG((x) > HARDWARE_ERROR_CORRECTABLE ? \ + (base) + _SOC_LERRUNCSTS : \ + (base) + _SOC_LERRCORSTS) +#define SOC_LOCAL_ERR_STAT_MASTER_REG (base, x) XE_REG((x) > HARDWARE_ERROR_CORRECTABLE ? \ + (base) + _SOC_LERRUNCSTS : \ + (base) + _SOC_LERRCORSTS) +#define _DEV_ERR_STAT_NONFATAL 0x100178#define _DEV_ERR_STAT_CORRECTABLE 0x10017c
@@ -20,6 +47,10 @@ _DEV_ERR_STAT_NONFATAL))#define XE_GT_ERROR 0#define XE_GSC_ERROR 8 +#define XE_SOC_ERROR 16 + +#define SOC_PVC_BASE 0x282000 +#define SOC_PVC_SLAVE_BASE 0x283000#define PVC_GSC_HECI1_BASE 0x284000#endif
drivers/gpu/drm/xe/xe_device_types.h +4 -0
@@ -420,6 +420,10 @@ struct xe_device {const struct err_name_index_pair *err_stat_gt[HARDWARE_ERROR_MAX ];const struct err_name_index_pair *err_vctr_gt[HARDWARE_ERROR_MAX ];const struct err_name_index_pair *gsc_error[HARDWARE_ERROR_MAX ]; +const struct err_name_index_pair *soc_mstr_glbl[HARDWARE_ERROR_MAX ]; +const struct err_name_index_pair *soc_mstr_lcl[HARDWARE_ERROR_MAX ]; +const struct err_name_index_pair *soc_slave_glbl[HARDWARE_ERROR_MAX ]; +const struct err_name_index_pair *soc_slave_lcl[HARDWARE_ERROR_MAX ]; } hw_err_regs;/* private: */
drivers/gpu/drm/xe/xe_hw_error.c +188 -0
218 lines not on this page · raw message
drivers/gpu/drm/xe/xe_hw_error.h +57 -2
77 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v2 5/10 drm/xe: Notify userspace about GSC HW errors.
In reply to Himal Prasad GhimiraySend uevent incase of nonfatal errors reported by gsc.
v2
- No need to provide tile info in uevent because error is accepted only in tile0. (Aravind)
--- drivers/gpu/drm/xe/xe_device_types.h | 3 +++ drivers/gpu/drm/xe/xe_hw_error.c | 16 ++++++++++++++++ drivers/gpu/drm/xe/xe_hw_error.h | 3 ++- drivers/gpu/drm/xe/xe_irq.c | 4 ++++ include/uapi/drm/xe_drm.h | 8 ++++++++ 5 files changed, 33 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_device_types.h +3 -0
@@ -196,6 +196,9 @@ struct xe_tile {struct tile_hw_errors {struct xarray hw_error; } errors; + +/** @gsc_hw_err_work: worker for uevent to report GSC HW errors */ +struct work_struct gsc_hw_err_work; };/**
drivers/gpu/drm/xe/xe_hw_error.c +16 -0
@@ -3,6 +3,8 @@* Copyright © 2023 Intel Corporation */ +#include <drm/xe_drm.h> +#include "xe_hw_error.h" #include "regs/xe_regs.h"
@@ -387,6 +389,19 @@ xe_gt_hw_error_handler(struct xe_gt *gt, const enum hardware_error hw_err)xe_gt_hw_error_log_vector_reg (gt, hw_err); } +void xe_gsc_hw_error_work (struct work_struct *work) +{ +struct xe_tile *tile =container_of (work,typeof (*tile), gsc_hw_err_work); +char *csc_hw_error_event[3 ]; + + csc_hw_error_event[0 ] =XE_GSC_HW_HEALTH_UEVENT "=1" ; + csc_hw_error_event[1 ] ="RESET_REQUIRED=1" ; + csc_hw_error_event[2 ] =NULL ; + +kobject_uevent_env (&tile->xe->drm.primary->kdev->kobj,KOBJ_CHANGE , + csc_hw_error_event); +} +static void xe_gsc_hw_error_handler (struct xe_tile *tile,const enum hardware_error hw_err) {
@@ -443,6 +458,7 @@ xe_gsc_hw_error_handler(struct xe_tile *tile, const enum hardware_error hw_err)drm_err_ratelimited (&tile_to_xe (tile)->drm,HW_ERR "Tile0 reported GSC %s %s error, bit[%d] is set\n" , name, hw_err_str, errbit); +schedule_work (&tile->gsc_hw_err_work); }if (indx !=XE_HW_ERR_TILE_UNSPEC ) xe_update_hw_error_cnt(&tile_to_xe(tile)->drm,
drivers/gpu/drm/xe/xe_hw_error.h +2 -1
@@ -7,6 +7,7 @@#include <linux/stddef.h> #include <linux/types.h> +#include <linux/workqueue.h> #define XE_RAS_REG_SIZE 32
@@ -110,5 +111,5 @@ struct xe_tile;void xe_hw_error_irq_handler (struct xe_tile *tile,const u32 master_ctl);void xe_assign_hw_err_regs (struct xe_device *xe);void xe_process_hw_errors (struct xe_device *xe); - +void xe_gsc_hw_error_work (struct work_struct *work);#endif
drivers/gpu/drm/xe/xe_irq.c +4 -0
@@ -614,6 +614,10 @@ int xe_irq_install(struct xe_device *xe)irq_handler_t irq_handler;int err, irq; +struct xe_tile *tile =xe_device_get_root_tile (xe); + +INIT_WORK (&tile->gsc_hw_err_work, xe_gsc_hw_error_work); + irq_handler =xe_irq_handler (xe);if (!irq_handler) {drm_err (&xe->drm,"No supported interrupt handler" );
include/uapi/drm/xe_drm.h +8 -0
@@ -16,6 +16,14 @@ extern "C" {* subject to backwards-compatibility constraints. */ +/** +* DOC: uevent generated by xe on it's tile node. +* +* XE_GSC_HW_HEALTH_UEVENT - Event is generated when GSC reports HW +* errors. The value supplied with the event is always "RESET_REQUIRED=1". +*/ +#define XE_GSC_HW_HEALTH_UEVENT "DEVICE_STATUS" +/** * DOC: uevent generated by xe on it's pci node. *
Signature · 1 line
2.25.1
PATCH v2 7/10 drm/xe: Support SOC NONFATAL error handling for PVC.
In reply to Himal Prasad GhimirayReport the SOC nonfatal hardware error and update the counters which will increment incase of error.
v2
- Use xe_assign_hw_err_regs to initilaize registers.
- Dont use the counters if error is being reported by second level registers.
- Fix Num of IEH to 2.
- Follow the convention source_typeoferror_errorname for enum and error reporting.(Aravind)
--- drivers/gpu/drm/xe/xe_hw_error.c | 70 +++++++++++++++++++++++++++++++- drivers/gpu/drm/xe/xe_hw_error.h | 39 ++++++++++++++++++ 2 files changed, 108 insertions(+), 1 deletion(-)
drivers/gpu/drm/xe/xe_hw_error.c +69 -1
@@ -258,6 +258,67 @@ static const struct err_name_index_pair pvc_soc_mstr_lcl_err_reg_fatal[] = { [14 ... 31] = {"Undefined", XE_HW_ERR_SOC_FATAL_UNKNOWN}, }; +static const struct err_name_index_pair pvc_soc_mstr_glbl_err_reg_nonfatal[] = { + [0 ] = {"MASTER LOCAL Reported" ,XE_HW_ERR_TILE_UNSPEC }, + [1 ] = {"SLAVE GLOBAL Reported" ,XE_HW_ERR_TILE_UNSPEC }, + [2 ] = {"HBM SS0: Channel0" ,XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL0 }, + [3 ] = {"HBM SS0: Channel1" ,XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL1 }, + [4 ] = {"HBM SS0: Channel2" ,XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL2 }, + [5 ] = {"HBM SS0: Channel3" ,XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL3 }, + [6 ] = {"HBM SS0: Channel4" ,XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL4 }, + [7 ] = {"HBM SS0: Channel5" ,XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL5 }, + [8 ] = {"HBM SS0: Channel6" ,XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL6 }, + [9 ] = {"HBM SS0: Channel7" ,XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL7 }, + [10 ] = {"HBM SS1: Channel0" ,XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL0 }, + [11 ] = {"HBM SS1: Channel1" ,XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL1 }, + [12 ] = {"HBM SS1: Channel2" ,XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL2 }, + [13 ] = {"HBM SS1: Channel3" ,XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL3 }, + [14 ] = {"HBM SS1: Channel4" ,XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL4 }, + [15 ] = {"HBM SS1: Channel5" ,XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL5 }, + [16 ] = {"HBM SS1: Channel6" ,XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL6 }, + [17 ] = {"HBM SS1: Channel7" ,XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL7 }, + [18 ...31 ] = {"Undefined" ,XE_HW_ERR_SOC_NONFATAL_UNKNOWN }, +}; + +static const struct err_name_index_pair pvc_soc_slave_glbl_err_reg_nonfatal[] = { + [0 ] = {"SLAVE LOCAL Reported" ,XE_HW_ERR_TILE_UNSPEC }, + [1 ] = {"HBM SS2: Channel0" ,XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL0 }, + [2 ] = {"HBM SS2: Channel1" ,XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL1 }, + [3 ] = {"HBM SS2: Channel2" ,XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL2 }, + [4 ] = {"HBM SS2: Channel3" ,XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL3 }, + [5 ] = {"HBM SS2: Channel4" ,XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL4 }, + [6 ] = {"HBM SS2: Channel5" ,XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL5 }, + [7 ] = {"HBM SS2: Channel6" ,XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL6 }, + [8 ] = {"HBM SS2: Channel7" ,XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL7 }, + [9 ] = {"HBM SS3: Channel0" ,XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL0 }, + [10 ] = {"HBM SS3: Channel1" ,XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL1 }, + [11 ] = {"HBM SS3: Channel2" ,XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL2 }, + [12 ] = {"HBM SS3: Channel3" ,XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL3 }, + [13 ] = {"HBM SS3: Channel4" ,XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL4 }, + [14 ] = {"HBM SS3: Channel5" ,XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL5 }, + [15 ] = {"HBM SS3: Channel6" ,XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL6 }, + [16 ] = {"HBM SS3: Channel7" ,XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL7 }, + [18 ] = {"ANR MDFI" ,XE_HW_ERR_SOC_NONFATAL_ANR_MDFI }, + [17 ] = {"Undefined" ,XE_HW_ERR_SOC_NONFATAL_UNKNOWN }, + [19 ...31 ] = {"Undefined" ,XE_HW_ERR_SOC_NONFATAL_UNKNOWN }, +}; + +static const struct err_name_index_pair pvc_soc_slave_lcl_err_reg_nonfatal[] = { + [0 ...31 ] = {"Undefined" ,XE_HW_ERR_SOC_NONFATAL_UNKNOWN }, +}; + +static const struct err_name_index_pair pvc_soc_mstr_lcl_err_reg_nonfatal[] = { + [0 ...3 ] = {"Undefined" ,XE_HW_ERR_SOC_NONFATAL_UNKNOWN }, + [4 ] = {"Base Die MDFI T2T" ,XE_HW_ERR_SOC_NONFATAL_MDFI_T2T }, + [5 ] = {"Undefined" ,XE_HW_ERR_SOC_NONFATAL_UNKNOWN }, + [6 ] = {"Base Die MDFI T2C" ,XE_HW_ERR_SOC_NONFATAL_MDFI_T2C }, + [7 ] = {"Undefined" ,XE_HW_ERR_SOC_NONFATAL_UNKNOWN }, + [8 ] = {"Invalid CSC PSF Command Parity" ,XE_HW_ERR_SOC_NONFATAL_CSC_PSF_CMD }, + [9 ] = {"Invalid CSC PSF Unexpected Completion" ,XE_HW_ERR_SOC_NONFATAL_CSC_PSF_CMP }, + [10 ] = {"Invalid CSC PSF Unsupported Request" ,XE_HW_ERR_SOC_NONFATAL_CSC_PSF_REQ }, + [11 ...31 ] = {"Undefined" ,XE_HW_ERR_SOC_NONFATAL_UNKNOWN }, +}; +void xe_assign_hw_err_regs (struct xe_device *xe) {const struct err_name_index_pair **dev_err_stat = xe->hw_err_regs.dev_err_stat;
@@ -295,6 +356,10 @@ void xe_assign_hw_err_regs(struct xe_device *xe) soc_mstr_lcl[HARDWARE_ERROR_FATAL ] = pvc_soc_mstr_lcl_err_reg_fatal; soc_slave_glbl[HARDWARE_ERROR_FATAL ] = pvc_soc_slave_glbl_err_reg_fatal; soc_slave_lcl[HARDWARE_ERROR_FATAL ] = pvc_soc_slave_lcl_err_reg_fatal; + soc_mstr_glbl[HARDWARE_ERROR_NONFATAL ] = pvc_soc_mstr_glbl_err_reg_nonfatal; + soc_mstr_lcl[HARDWARE_ERROR_NONFATAL ] = pvc_soc_mstr_lcl_err_reg_nonfatal; + soc_slave_glbl[HARDWARE_ERROR_NONFATAL ] = pvc_soc_slave_glbl_err_reg_nonfatal; + soc_slave_lcl[HARDWARE_ERROR_NONFATAL ] = pvc_soc_slave_lcl_err_reg_nonfatal; } }
@@ -578,7 +643,10 @@ xe_soc_hw_error_handler(struct xe_tile *tile, const enum hardware_error hw_err)lockdep_assert_held (&tile_to_xe (tile)->irq.lock); -if ((tile_to_xe (tile)->info.platform !=XE_PVC ) || hw_err !=HARDWARE_ERROR_FATAL ) +if (tile_to_xe (tile)->info.platform !=XE_PVC ) +return ; + +if (hw_err ==HARDWARE_ERROR_CORRECTABLE )return ; base =SOC_PVC_BASE ;
drivers/gpu/drm/xe/xe_hw_error.h +39 -0
@@ -112,6 +112,45 @@ enum xe_soc_hw_errors {XE_HW_ERR_SOC_FATAL_PCIE_PSF_CMD ,XE_HW_ERR_SOC_FATAL_PCIE_PSF_CMP ,XE_HW_ERR_SOC_FATAL_PCIE_PSF_REQ , +XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL0 , +XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL1 , +XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL2 , +XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL3 , +XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL4 , +XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL5 , +XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL6 , +XE_HW_ERR_SOC_NONFATAL_HBM0_CHNL7 , +XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL0 , +XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL1 , +XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL2 , +XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL3 , +XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL4 , +XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL5 , +XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL6 , +XE_HW_ERR_SOC_NONFATAL_HBM1_CHNL7 , +XE_HW_ERR_SOC_NONFATAL_UNKNOWN , +XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL0 , +XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL1 , +XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL2 , +XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL3 , +XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL4 , +XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL5 , +XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL6 , +XE_HW_ERR_SOC_NONFATAL_HBM2_CHNL7 , +XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL0 , +XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL1 , +XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL2 , +XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL3 , +XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL4 , +XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL5 , +XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL6 , +XE_HW_ERR_SOC_NONFATAL_HBM3_CHNL7 , +XE_HW_ERR_SOC_NONFATAL_ANR_MDFI , +XE_HW_ERR_SOC_NONFATAL_MDFI_T2T , +XE_HW_ERR_SOC_NONFATAL_MDFI_T2C , +XE_HW_ERR_SOC_NONFATAL_CSC_PSF_CMD , +XE_HW_ERR_SOC_NONFATAL_CSC_PSF_CMP , +XE_HW_ERR_SOC_NONFATAL_CSC_PSF_REQ , XE_TILE_HW_ERROR_MAX, };
Signature · 1 line
2.25.1
PATCH v2 8/10 drm/xe: Handle MDFI error severity.
In reply to Himal Prasad GhimirayNONFATAL and FATAL MDFI(T2T/T2C) errors are reported by same IEH register and bits (Bit 4 and Bit 6 of 0x282280). To determine the severity read local first error header log register (0x2822b0). Value 0x00330000 ensures severity is fatal and 0x00310000 is for NONFATAL errors. This register doesn't need explicit clearing, clearing MDFI bit in IEH reg will clear this register too. Incase of nonfatal value being reported by status register in fatal flow don't clean the MDFI IEH bit and continue. Same needs to be addressed if value read by status register is fatal in nonfatal flow.
v2
- Add commit message.
--- drivers/gpu/drm/xe/regs/xe_tile_error_regs.h | 9 +++++++++ drivers/gpu/drm/xe/xe_hw_error.c | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/regs/xe_tile_error_regs.h +9 -0
@@ -38,6 +38,8 @@#define SOC_LOCAL_ERR_STAT_MASTER_REG (base, x) XE_REG((x) > HARDWARE_ERROR_CORRECTABLE ? \ (base) + _SOC_LERRUNCSTS : \ (base) + _SOC_LERRCORSTS) +#define MDFI_T2T 4 +#define MDFI_T2C 6#define _DEV_ERR_STAT_NONFATAL 0x100178
@@ -50,6 +52,13 @@#define XE_SOC_ERROR 16#define SOC_PVC_BASE 0x282000 + +#define LOCAL_FIRST_IEH_HEADER_LOG_REG XE_REG(0x2822b0) +#define MDFI_SEVERITY_FATAL 0x00330000 +#define MDFI_SEVERITY_NONFATAL 0x00310000 +#define MDFI_SEVERITY (x) ((x) == HARDWARE_ERROR_FATAL ? \ + MDFI_SEVERITY_FATAL : \ + MDFI_SEVERITY_NONFATAL)#define SOC_PVC_SLAVE_BASE 0x283000#define PVC_GSC_HECI1_BASE 0x284000
drivers/gpu/drm/xe/xe_hw_error.c +14 -2
@@ -636,7 +636,7 @@ xe_soc_hw_error_handler(struct xe_tile *tile, const enum hardware_error hw_err) {unsigned long mst_glb_errstat, slv_glb_errstat, lcl_errstat;struct hardware_errors_regs *err_regs; -u32 errbit, base, slave_base; +u32 errbit, base, slave_base, ieh_header;int i;struct xe_gt *gt = tile->primary_gt;
@@ -704,9 +704,21 @@ xe_soc_hw_error_handler(struct xe_tile *tile, const enum hardware_error hw_err)"Tile%d reported SOC_LOCAL_ERR_STAT_MASTER_REG_FATAL:0x%08lx\n" , tile->id, lcl_errstat); -for_each_set_bit (errbit, &lcl_errstat,XE_RAS_REG_SIZE ) +for_each_set_bit (errbit, &lcl_errstat,XE_RAS_REG_SIZE ) { +if (errbit ==MDFI_T2T || errbit ==MDFI_T2C ) { + ieh_header =xe_mmio_read32 (gt,LOCAL_FIRST_IEH_HEADER_LOG_REG ); +drm_info (&tile_to_xe (tile)->drm,HW_ERR "Tile%d LOCAL_FIRST_IEH_HEADER_LOG_REG:0x%08x\n" , + tile->id, ieh_header); + +if (ieh_header !=MDFI_SEVERITY (hw_err)) { + lcl_errstat &= ~REG_BIT (errbit); +continue ; + } + } +xe_soc_log_err_update_cntr (tile, hw_err, errbit, err_regs->soc_mstr_lcl[hw_err]); + }xe_mmio_write32 (gt,SOC_LOCAL_ERR_STAT_MASTER_REG (base, hw_err), lcl_errstat); }
Signature · 1 line
2.25.1
PATCH v3 10/10 drm/xe: Clear all SoC errors post warm reset.
In reply to Himal Prasad GhimirayThere are scenarios where there are errors being reported from the SoC uncore to IEH and not propagated to SG unit. Since these errors are not propagated to SG unit, driver won't be able to clean them as part of xe_process_hw_error. Hence clear all SoC register post xe_process_hw_error during the driver load.
v2
- Fix commit message.
v3
- Limit check to PVC.
--- drivers/gpu/drm/xe/xe_hw_error.c | 40 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/xe/xe_hw_error.h | 1 + drivers/gpu/drm/xe/xe_irq.c | 1 + 3 files changed, 42 insertions(+)
drivers/gpu/drm/xe/xe_hw_error.c +40 -0
@@ -519,6 +519,46 @@ xe_gt_hw_error_log_vector_reg(struct xe_gt *gt, const enum hardware_error hw_err } } +void xe_clear_all_soc_errors (struct xe_device *xe) +{ +enum hardware_error hw_err; +u32 base, slave_base; +struct xe_tile *tile; +struct xe_gt *gt; +unsigned int i; + +if ((tile_to_xe (tile)->info.platform !=XE_PVC )) +return ; + + base =SOC_PVC_BASE ; + slave_base =SOC_PVC_SLAVE_BASE ; + + hw_err =HARDWARE_ERROR_CORRECTABLE ; + +for_each_tile (tile, xe, i) { + gt = tile->primary_gt; + +while (hw_err <HARDWARE_ERROR_MAX ) { +for (i =0 ; i <XE_SOC_NUM_IEH ; i++) +xe_mmio_write32 (gt,SOC_GSYSEVTCTL_REG (base, slave_base, i), + ~REG_BIT (hw_err)); + +xe_mmio_write32 (gt,SOC_GLOBAL_ERR_STAT_MASTER_REG (base, hw_err), +REG_GENMASK (31 ,0 )); +xe_mmio_write32 (gt,SOC_LOCAL_ERR_STAT_MASTER_REG (base, hw_err), +REG_GENMASK (31 ,0 )); +xe_mmio_write32 (gt,SOC_GLOBAL_ERR_STAT_SLAVE_REG (slave_base, hw_err), +REG_GENMASK (31 ,0 )); +xe_mmio_write32 (gt,SOC_LOCAL_ERR_STAT_SLAVE_REG (slave_base, hw_err), +REG_GENMASK (31 ,0 )); + hw_err++; + } +for (i =0 ; i <XE_SOC_NUM_IEH ; i++) +xe_mmio_write32 (gt,SOC_GSYSEVTCTL_REG (base, slave_base, i), + (HARDWARE_ERROR_MAX <<1 ) +1 ); + } +} +static void xe_gt_hw_error_handler (struct xe_gt *gt,const enum hardware_error hw_err) {
drivers/gpu/drm/xe/xe_hw_error.h +1 -0
@@ -206,4 +206,5 @@ void xe_hw_error_irq_handler(struct xe_tile *tile, const u32 master_ctl);void xe_assign_hw_err_regs (struct xe_device *xe);void xe_process_hw_errors (struct xe_device *xe);void xe_gsc_hw_error_work (struct work_struct *work); +void xe_clear_all_soc_errors (struct xe_device *xe);#endif
drivers/gpu/drm/xe/xe_irq.c +1 -0
@@ -626,6 +626,7 @@ int xe_irq_install(struct xe_device *xe)xe_assign_hw_err_regs (xe);xe_process_hw_errors (xe); +xe_clear_all_soc_errors (xe);xe_irq_reset (xe);
Signature · 1 line
2.25.1
Please ignore this.
Will resent with fixing the Subject.
________________________________
From: Ghimiray, Himal Prasad <[email protected]>
Sent: Wednesday, October 18, 2023 8:18:28 AM
To: [email protected] <[email protected]>
Cc: Ghimiray, Himal Prasad <[email protected]>
Subject: [PATCH v8 00/10] *Supporting RAS on XE
Our platforms support Reliability, Availability and Serviceability(RAS). In case of hardware errors, our hardwares provides the causes via sending interrupt or pcie errors. The fatal errors are propogated as pci errors and non fatal errors as MSI. This series focuses on loging and updating counters for these errors, which will be helpful to avoid, detect and repair hardware faults.
This [1] series proposes mechanism to expose this counters to userspace. [1]: https://patchwork.freedesktop.org/series/118435/
The error counters exposed by KMD will be used by L0/sysman They will be categorized to specific category of error in sysman:
https://spec.oneapi.io/level-zero/latest/sysman/api.html#ras
We have very limited capabilities for error injection to validate the
code flow.
Output of L3 fabric fatal injection from PVC is:
xe 0000:8c:00.0: [drm] *ERROR* [Hardware Error]: TILE0 detected GT FATAL error bit[0] is set
xe 0000:8c:00.0: [drm] *ERROR* [Hardware Error]: GT0 detected L3 FABRIC FATAL error. ERR_VECT_GT_FATAL[7]:0x00000087
v2
- Use different headers for error registers. (Nikula)
- Correctable errors shouldn't be considered as dmesg errors (Matt)
- Limit series to HW errors.(Aravind)
v3
- Rebase
v4
- Use xe_regs.h only for registers, move enums out of it.
- Make sure global data/structures are immutable.
- Avoid adding custom error logging macro's.
- Redesign the registers error name and counter index structures for maintainability. (Nikula)
v5
- move struct hw_err_regs out of CONFIG_DRM_XE_DISPLAY.
v6
- Addressing Review comments from Aravind.
v7
- CI fixes.
v8
- Conditional check fixes.
Himal Prasad Ghimiray (4):
drm/xe: Handle errors from various components. drm/xe: Log and count the GT hardware errors. drm/xe: Support GT hardware error reporting for PVC. drm/xe: Support GSC hardware error reporting for PVC. drm/xe: Notify userspace about GSC HW errors. drm/xe: Support SOC FATAL error handling for PVC. drm/xe: Support SOC NONFATAL error handling for PVC. drm/xe: Handle MDFI error severity.
drm/xe: Clear SOC CORRECTABLE error registers. drm/xe: Clear all SoC errors post warm reset.
drivers/gpu/drm/xe/Makefile | 1 + drivers/gpu/drm/xe/regs/xe_gt_error_regs.h | 29 + drivers/gpu/drm/xe/regs/xe_regs.h | 5 +- drivers/gpu/drm/xe/regs/xe_tile_error_regs.h | 65 ++ drivers/gpu/drm/xe/xe_device.c | 14 + drivers/gpu/drm/xe/xe_device_types.h | 21 + drivers/gpu/drm/xe/xe_gt.c | 1 + drivers/gpu/drm/xe/xe_gt_types.h | 7 + drivers/gpu/drm/xe/xe_hw_error.c | 919 +++++++++++++++++++ drivers/gpu/drm/xe/xe_hw_error.h | 210 +++++ drivers/gpu/drm/xe/xe_irq.c | 9 + drivers/gpu/drm/xe/xe_tile.c | 1 + include/uapi/drm/xe_drm.h | 8 + 13 files changed, 1289 insertions(+), 1 deletion(-) create mode 100644 drivers/gpu/drm/xe/regs/xe_gt_error_regs.h create mode 100644 drivers/gpu/drm/xe/regs/xe_tile_error_regs.h create mode 100644 drivers/gpu/drm/xe/xe_hw_error.c create mode 100644 drivers/gpu/drm/xe/xe_hw_error.h
--
2.25.1