Re: [PATCH v3 06/10] drm/xe/xe_ras: Add structures and commands for Uncorrectable Core Compute Errors

Raag Jadav
2026-04-07T05:59:38Z

On Thu, Apr 02, 2026 at 12:31:37PM +0530, Riana Tauro wrote:
> Add the sysctrl commands and response structures for Uncorrectable
> Core Compute errors.

...

> +static const char * const xe_ras_severities[] = {
> + [XE_RAS_SEVERITY_NOT_SUPPORTED] = "Not Supported",
> + [XE_RAS_SEVERITY_CORRECTABLE] = "Correctable",
> + [XE_RAS_SEVERITY_UNCORRECTABLE] = "Uncorrectable",
> + [XE_RAS_SEVERITY_INFORMATIONAL] = "Informational",
> +};
> +static_assert(ARRAY_SIZE(xe_ras_severities) == XE_RAS_SEVERITY_MAX);
> +
> +static const char * const xe_ras_components[] = {
> + [XE_RAS_COMPONENT_NOT_SUPPORTED] = "Not Supported",
> + [XE_RAS_COMPONENT_DEVICE_MEMORY] = "Device Memory",
> + [XE_RAS_COMPONENT_CORE_COMPUTE] = "Core Compute",
> + [XE_RAS_COMPONENT_RESERVED] = "Reserved",
> + [XE_RAS_COMPONENT_PCIE] = "PCIe",
> + [XE_RAS_COMPONENT_FABRIC] = "Fabric",
> + [XE_RAS_COMPONENT_SOC_INTERNAL] = "SoC Internal",
> +};
> +static_assert(ARRAY_SIZE(xe_ras_components) == XE_RAS_COMPONENT_MAX);
> +
> +static inline const char *severity_to_str(struct xe_device *xe, u32 severity)
> +{
> + xe_assert(xe, severity < XE_RAS_SEVERITY_MAX);
> +
> + return severity < XE_RAS_SEVERITY_MAX ? xe_ras_severities[severity] : "Unknown";

Rethinking about this, since we already have NOT_SUPPORTED member, can we
reuse it for "Unknown"?

static inline const char *sev_to_str(struct xe_device *xe, u32 sev)
{
if (sev >= XE_RAS_SEV_MAX)
sev = XE_RAS_SEV_NOT_SUPPORTED;

xe_assert(xe, severity != XE_RAS_SEV_NOT_SUPPORTED);
return xe_ras_severities[sev];
}

Or you can choose to drop xe_assert() entirely if it makes more sense.

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

Ditto.

Raag

> +}