Re: [PATCH v2 07/11] drm/xe/xe_ras: Add structures and commands for Uncorrectable Core Compute Errors

Raag Jadav
2026-03-04T16:32:57Z

On Mon, Mar 02, 2026 at 03:52:02PM +0530, Riana Tauro wrote:
> Add the sysctrl commands and response structures for Uncorrectable
> Core Compute errors.

...

> +static inline const char *severity_to_str(struct xe_device *xe, u32 severity)
> +{
> + if (severity >= XE_RAS_SEVERITY_MAX)
> + return "Unknown Severity";
> +
> + return xe_ras_severities[severity];

Rather,

return sev < XE_RAS_SEV_MAX ? xe_ras_severities[sev] : "Unknown";

and since this should ideally never happen, I'd also add a

xe_assert(xe, sev < XE_RAS_SEV_MAX);
> +}
> +
> +static inline const char *comp_to_str(struct xe_device *xe, u32 comp)
> +{
> + if (comp >= XE_RAS_COMPONENT_MAX)
> + return "Unknown Component";
> +
> + return xe_ras_components[comp];

Ditto.

Raag

> +}