All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/xe/ras: Fix sysctrl and drm-ras discrepancy
@ 2026-09-10 14:25 Raag Jadav
  2026-09-10 14:34 ` ✓ CI.KUnit: success for drm/xe/ras: Fix sysctrl and drm-ras discrepancy (rev2) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Raag Jadav @ 2026-09-10 14:25 UTC (permalink / raw)
  To: intel-xe; +Cc: riana.tauro, Raag Jadav

There are cases where a reported error is valid for sysctrl but it's
not exposed as a valid uapi through drm-ras. We allow such error to be
logged but it's redundant to try to send an error-event for it. Early
return such cases and prevent misleading drm-ras error-event failures.

Fixes: 6a9493e47075 ("drm/xe/xe_ras: Report correctable/uncorrectable error events to userspace")
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
---
v2: Move sanity check to xe_drm_ras (Riana)
---
 drivers/gpu/drm/xe/xe_drm_ras.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/xe/xe_drm_ras.c b/drivers/gpu/drm/xe/xe_drm_ras.c
index 7f3695707611..5e6d4926d08e 100644
--- a/drivers/gpu/drm/xe/xe_drm_ras.c
+++ b/drivers/gpu/drm/xe/xe_drm_ras.c
@@ -16,6 +16,17 @@
 static const char * const error_components[] = DRM_XE_RAS_ERROR_COMPONENT_NAMES;
 static const char * const error_severity[] = DRM_XE_RAS_ERROR_SEVERITY_NAMES;
 
+static bool drm_ras_counter_is_valid(u32 severity, u32 component)
+{
+	if (!in_range(severity, DRM_XE_RAS_ERR_SEV_CORRECTABLE, DRM_XE_RAS_ERR_SEV_MAX))
+		return false;
+
+	if (!in_range(component, DRM_XE_RAS_ERR_COMP_CORE_COMPUTE, DRM_XE_RAS_ERR_COMP_MAX - 1))
+		return false;
+
+	return true;
+}
+
 static int query_error_counter(struct xe_device *xe,
 			       enum drm_xe_ras_error_severity severity,
 			       u32 error_id, const char **name, u32 *val)
@@ -239,6 +250,9 @@ void xe_drm_ras_event(struct xe_device *xe, u32 component, u32 severity, u32 val
 	if (!xe->info.has_drm_ras)
 		return;
 
+	if (!drm_ras_counter_is_valid(severity, component))
+		return;
+
 	node = &ras->node[severity];
 
 	if (!info || !info[component].name)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-10 21:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-10 14:25 [PATCH v2] drm/xe/ras: Fix sysctrl and drm-ras discrepancy Raag Jadav
2026-09-10 14:34 ` ✓ CI.KUnit: success for drm/xe/ras: Fix sysctrl and drm-ras discrepancy (rev2) Patchwork
2026-09-10 14:39 ` [PATCH v2] drm/xe/ras: Fix sysctrl and drm-ras discrepancy sashiko-bot
2026-09-10 15:12 ` ✓ Xe.CI.BAT: success for drm/xe/ras: Fix sysctrl and drm-ras discrepancy (rev2) Patchwork
2026-09-10 21:47 ` ✓ Xe.CI.FULL: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.