From: Raag Jadav <raag.jadav@intel.com>
To: "Tauro, Riana" <riana.tauro@intel.com>
Cc: intel-xe@lists.freedesktop.org, anshuman.gupta@intel.com,
rodrigo.vivi@intel.com, aravind.iddamsetty@linux.intel.com,
badal.nilawar@intel.com, ravi.kishore.koppuravuri@intel.com,
mallesh.koujalagi@intel.com, soham.purkait@intel.com
Subject: Re: [PATCH v2 3/5] drm/xe/xe_ras: Add support to query error counter for CRI
Date: Mon, 20 Apr 2026 10:21:13 +0200 [thread overview]
Message-ID: <aeXh-QaXIpqBY1Mn@black.igk.intel.com> (raw)
In-Reply-To: <00921c44-5120-4d77-841c-efd199f37f49@intel.com>
On Mon, Apr 20, 2026 at 12:03:06PM +0530, Tauro, Riana wrote:
> On 4/13/2026 2:49 PM, Raag Jadav wrote:
> > On Mon, Apr 06, 2026 at 08:24:42PM +0530, Riana Tauro wrote:
> > > Add support to get error counter value for CRI.
> > >
> > > When userspace queries a drm_ras error counter, fetch the
> > > latest counter value from system controller.
...
> > > +static int get_error_counter(struct xe_device *xe, struct xe_ras_error_class *error_class,
> > > + u32 *value)
> > > +{
> > > + struct xe_ras_get_counter_response response = {0};
> > > + struct xe_ras_get_counter_request request = {0};
> > > + struct xe_sysctrl_mailbox_command command = {0};
> > > + size_t rlen;
> > > + int ret;
> > > +
> > > + request.error_class = *error_class;
> > > +
> > > + prepare_sysctrl_command(&command, XE_SYSCTRL_CMD_GET_COUNTER, &request, sizeof(request),
> > > + &response, sizeof(response));
> > > +
> > > + ret = xe_sysctrl_send_command(&xe->sc, &command, &rlen);
> > > + if (ret) {
> > > + xe_err(xe, "[RAS]: Sysctrl error ret %d\n", ret);
> > This gives the impression of RAS error, but is it really?
>
> This command can be used from different components. This will help
> differentiate
> the file.
File is not much useful for debugging, what's probably more useful is
distinguishable error message.
xe_err(xe, "sysctrl: failed to get counter %d\n", ret);
or perhaps
xe_err(xe, "sysctrl: command %x failed with %d\n", cmd, ret);
Also, I think [RAS] tag should be exclusive to hardware errors but I'll
leave it to you all.
> > > + return ret;
> > > + }
> > > +
> > > + if (rlen != sizeof(response)) {
> > > + xe_err(xe, "[RAS]: Sysctrl response size mismatch. Expected %zu, got %zu\n",
> > Ditto.
> >
> > > + sizeof(response), rlen);
> > > + return -EINVAL;
> > Is this propagated back to the user? If yes, is this the correct error
> > code for the scenario?
>
> Yes the error code will be propagated back to the user. Any suggestions?
> EIO for system controller errors?
Yep, we tried to query system controller but it had different (or perhaps
no) idea what it was.
PS: Probably another reason to not have [RAS] in error message ;)
Raag
> > > + }
> > > +
> > > + *value = response.counter_value;
> > > +
> > > + return 0;
> > > +}
next prev parent reply other threads:[~2026-04-20 8:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 14:54 [PATCH v2 0/5] Add get-error-counter and clear-error-counter support for CRI Riana Tauro
2026-04-06 14:54 ` [PATCH v2 1/5] drm/xe/uapi: Add additional error components to XE drm_ras Riana Tauro
2026-04-06 14:54 ` [PATCH v2 2/5] drm/xe/xe_ras: Add structures and commands for get and clear counter Riana Tauro
2026-04-13 9:03 ` Raag Jadav
2026-04-20 7:50 ` Tauro, Riana
2026-04-06 14:54 ` [PATCH v2 3/5] drm/xe/xe_ras: Add support to query error counter for CRI Riana Tauro
2026-04-13 9:19 ` Raag Jadav
2026-04-20 6:33 ` Tauro, Riana
2026-04-20 8:21 ` Raag Jadav [this message]
2026-04-06 14:54 ` [PATCH v2 4/5] drm/xe/xe_ras: Add helper to clear error counter Riana Tauro
2026-04-13 9:25 ` Raag Jadav
2026-04-20 7:48 ` Tauro, Riana
2026-04-06 14:54 ` [PATCH v2 5/5] drm/xe/ras: Add flag for Xe RAS Riana Tauro
2026-04-06 14:54 ` ✗ CI.checkpatch: warning for Add get-error-counter and clear-error-counter support for CRI Patchwork
2026-04-06 14:56 ` ✓ CI.KUnit: success " Patchwork
2026-04-06 15:32 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-06 18:50 ` ✗ Xe.CI.FULL: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aeXh-QaXIpqBY1Mn@black.igk.intel.com \
--to=raag.jadav@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=aravind.iddamsetty@linux.intel.com \
--cc=badal.nilawar@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=mallesh.koujalagi@intel.com \
--cc=ravi.kishore.koppuravuri@intel.com \
--cc=riana.tauro@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=soham.purkait@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox