mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
drm/xe/hw_error: Cleanup array map
xe_hw_error_map[] is not worth the memory needed to map two components. Clean it up and use switch() instead, which also, in turn, simplifies bounds checking logic. add/remove: 0/1 grow/shrink: 0/1 up/down: 0/-425 (-425) Function old new delta xe_hw_error_map 136 - -136 xe_hw_error_irq_handler 3728 3439 -289 Total: Before=7700, After=7275, chg -5.52% Signed-off-by: Raag Jadav <raag.jadav@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://patch.msgid.link/20260502180143.1450266-1-raag.jadav@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
This commit is contained in:
parent
7d9c39cfb3
commit
ead21111e2
|
|
@ -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",
|
||||
|
|
@ -459,14 +466,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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user