On Thu, Jul 16, 2026 at 03:27:59PM +0530, Tauro, Riana wrote:
> On 09-07-2026 15:34, Raag Jadav wrote:
> > On Wed, Jul 01, 2026 at 03:14:13PM +0530, Riana Tauro wrote:
> > > Add error-event support for Correctable errors in CRI. Report an error
> > > event to userspace for every component that has crossed the threshold on
> > > receiving an interrupt.
> > ...
> >
> > > +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) {
> > > + xe_warn(xe, "sysctrl: unexpected severity %u\n", severity);
> > This is uapi and not coming from sysctrl, so the message is a bit
> > misleading. But if at all it needs validation, it should be done in
> > drm_ras layer.
>
> You mean in the ras_event function? The parameters to this function are
> coming from sysctrl.
> So added sysctrl flag
We shouldn't be at this point without valid severity and component, and
this also contradicts the if condition which is for uapi.
> > > + return;
> > > + }
> > > +
> > > + drm_component = xe_to_drm_ras_component(component);
> > > + if (drm_component == DRM_XE_RAS_ERR_COMP_MAX) {
> > > + xe_warn(xe, "sysctrl: unexpected component %u\n", component);
> > Ditto.
> >
> > > + return;
> > > + }
> > > +
> > > + ret = xe_ras_get_counter(xe, drm_severity, drm_component, &value);
> > No, instead of converting back and forth just do get_counter() using
> > sysctrl values and send_event() afterwards.
>
> The reason for using this is to avoid unnecessary churn of moving the get
> counter above or use forward declaration.
> Yeah i can use that too directly.
You already get a counter as part of threshold crossed event, which you
can directly pass to get_counter() instead of dealing with severity and
component individually.
Raag