summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_hw_error.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/xe/xe_hw_error.c')
-rw-r--r--drivers/gpu/drm/xe/xe_hw_error.c32
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/gpu/drm/xe/xe_hw_error.c b/drivers/gpu/drm/xe/xe_hw_error.c
index 2a31b430570e..5135e8e4093f 100644
--- a/drivers/gpu/drm/xe/xe_hw_error.c
+++ b/drivers/gpu/drm/xe/xe_hw_error.c
@@ -36,11 +36,6 @@ static const char * const hec_uncorrected_fw_errors[] = {
"Data Corruption"
};
-static const unsigned long xe_hw_error_map[] = {
- [XE_GT_ERROR] = DRM_XE_RAS_ERR_COMP_CORE_COMPUTE,
- [XE_SOC_ERROR] = DRM_XE_RAS_ERR_COMP_SOC_INTERNAL,
-};
-
enum gt_vector_regs {
ERR_STAT_GT_VECTOR0 = 0,
ERR_STAT_GT_VECTOR1,
@@ -65,6 +60,18 @@ static enum drm_xe_ras_error_severity hw_err_to_severity(const enum hardware_err
return DRM_XE_RAS_ERR_SEV_UNCORRECTABLE;
}
+static inline u32 err_src_to_id(u32 err_bit)
+{
+ switch (err_bit) {
+ case XE_GT_ERROR:
+ return DRM_XE_RAS_ERR_COMP_CORE_COMPUTE;
+ case XE_SOC_ERROR:
+ return DRM_XE_RAS_ERR_COMP_SOC_INTERNAL;
+ default:
+ return 0;
+ }
+}
+
static const char * const pvc_master_global_err_reg[] = {
[0 ... 1] = "Undefined",
[2] = "HBM SS0: Channel0",
@@ -169,11 +176,8 @@ static void csc_hw_error_work(struct work_struct *work)
{
struct xe_tile *tile = container_of(work, typeof(*tile), csc_hw_error_work);
struct xe_device *xe = tile_to_xe(tile);
- int ret;
- ret = xe_survivability_mode_runtime_enable(xe);
- if (ret)
- drm_err(&xe->drm, "Failed to enable runtime survivability mode\n");
+ xe_survivability_mode_runtime_enable(xe);
}
static void csc_hw_error_handler(struct xe_tile *tile, const enum hardware_error hw_err)
@@ -459,14 +463,8 @@ static void hw_error_source_handler(struct xe_tile *tile, const enum hardware_er
const char *name;
u32 error_id;
- /* Check error bit is within bounds */
- if (err_bit >= ARRAY_SIZE(xe_hw_error_map))
- break;
-
- error_id = xe_hw_error_map[err_bit];
-
- /* Check error component is within max */
- if (!error_id || error_id >= DRM_XE_RAS_ERR_COMP_MAX)
+ error_id = err_src_to_id(err_bit);
+ if (!error_id)
continue;
name = info[error_id].name;