On 30-06-2026 10:50, Raag Jadav wrote:
On Mon, Jun 22, 2026 at 03:47:20PM +0530, Riana Tauro wrote:
Add error-event support for Correctable errors in CRI.
error-event is reported to  userspace for all errors that crossed
threshold on receiving an interrupt for correctable errors.
...

+static void ras_send_error_event(struct xe_device *xe, u8 severity, u8 
component)
+{
+       u8 drm_severity, drm_component;
+       u32 value;
+       int ret;
+
+       drm_severity = xe_to_drm_ras_severity(severity);
+       if (drm_severity == DRM_XE_RAS_ERR_SEV_MAX)
+               return;
+
+       drm_component = xe_to_drm_ras_component(component);
+       if (drm_component == DRM_XE_RAS_ERR_COMP_MAX)
+               return;
+
+       ret = xe_ras_get_counter(xe, severity, component, &value);
+       if (ret)
+               return;
+
+       xe_drm_ras_event(xe, drm_component, drm_severity, value, GFP_KERNEL);
+}
+
  void xe_ras_counter_threshold_crossed(struct xe_device *xe,
                                      struct xe_sysctrl_event_response 
*response)
  {
@@ -152,6 +203,8 @@ void xe_ras_counter_threshold_crossed(struct xe_device *xe,
                severity = errors[id].common.severity;
                component = errors[id].common.component;
+ ras_send_error_event(xe, severity, component);
We already have error-value as part of the event, so this looks like
a lot of redundant duplicate events if threshold is set high enough.

Yeah makes sense based on testing. Will add it once per error type.

Thanks
Riana

I'm wondering if we use a local variable as a bitmap for components
(which we set here) and only send event for_each_set_bit() after the
loop?

Raag

                xe_warn(xe, "[RAS]: %s %s detected\n",
                        comp_to_str(component), sev_to_str(severity));
        }
--
2.47.1

Reply via email to