Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: "Tauro, Riana" <riana.tauro@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	intel-xe@lists.freedesktop.org, matthew.d.roper@intel.com,
	soham.purkait@intel.com
Subject: Re: [PATCH v1] drm/xe/ras: Fix invalid health error code
Date: Tue, 4 Aug 2026 12:16:30 +0200	[thread overview]
Message-ID: <anG7_k5P3DJezk8n@black.igk.intel.com> (raw)
In-Reply-To: <75f2a523-ac6d-4470-a87a-33d9ccc07540@intel.com>

On Tue, Aug 04, 2026 at 02:01:16PM +0530, Tauro, Riana wrote:
> On 04-08-2026 13:37, Raag Jadav wrote:
> > On Tue, Aug 04, 2026 at 08:56:12AM +0200, Michal Wajdeczko wrote:
> > > On 8/4/2026 8:36 AM, Tauro, Riana wrote:
> > > > On 04-08-2026 10:42, Raag Jadav wrote:
> > > > > We use -EBADMSG for corrupted responses from sysctrl. Fix the error code.
> > > > Let's keep it -EIO as it's more appropriate for sysctrl errors and consistent than
> > > > 
> > > > #define    EBADMSG        74    /* Not a data message */
> > The response size is valid, it's just the contents are corrupted. Similar
> > to what we did with commit 948eee331bef ("drm/xe/ras: Validate sysctrl
> > response") and more consistent here.
> > 
> > > btw, inside GuC CTB code we use
> > > 
> > > 	-EPIPE		// for corrupted message/channel
> > > 	-EPROTO		// for unexpected content in the message
> > We have a bunch of these as a response status, check ras_status_to_errno().
> > The one proposed here is for the values deemed acceptable as per spec.
> > 
> > > as -EIO is too generic
> > Agree.
> 
> Using -EIO consistently for system controller errors allows easier debugging
> for
> sysctrl commands.  When any sysctrl ops fail we know it's not RAS layer.

We still log it as a sysctrl error, so nothing changed from debugging POV
here. Besides, error codes are what make the failure cases distinguishable
to the consumer, otherwise we wouldn't have so many of them :)

> The only other error code we see is directly from firmware status.

I'm all for trusting what the firmware tells me, but this has caused more
problems than solved historically :)

> This is my thought. I will leave it upto you

Sure.

Raag

> > > > > Fixes: 53a7115f9862 ("drm/xe/xe_ras: Add RAS GPU health indicator")
> > > > > Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> > > > > ---
> > > > >    drivers/gpu/drm/xe/xe_ras.c | 4 ++--
> > > > >    1 file changed, 2 insertions(+), 2 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/gpu/drm/xe/xe_ras.c b/drivers/gpu/drm/xe/xe_ras.c
> > > > > index f7af4da8172c..bdad0621ae12 100644
> > > > > --- a/drivers/gpu/drm/xe/xe_ras.c
> > > > > +++ b/drivers/gpu/drm/xe/xe_ras.c
> > > > > @@ -700,7 +700,7 @@ static ssize_t gpu_health_show(struct device *dev, struct device_attribute *attr
> > > > >        if (response.health >= XE_RAS_HEALTH_MAX) {
> > > > >            xe_err(xe, "sysctrl: invalid health state %u\n",
> > > > >                   response.health);
> > > > > -        return -EIO;
> > > > > +        return -EBADMSG;
> > > > >        }
> > > > >          health = gpu_health_states[response.health];
> > > > > @@ -753,7 +753,7 @@ static ssize_t gpu_health_store(struct device *dev, struct device_attribute *att
> > > > >        if (response.health >= XE_RAS_HEALTH_MAX) {
> > > > >            xe_err(xe, "sysctrl: invalid health state %u\n",
> > > > >                   response.health);
> > > > > -        return -EIO;
> > > > > +        return -EBADMSG;
> > > > >        }
> > > > >          health = gpu_health_states[response.health];

  reply	other threads:[~2026-08-04 10:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-04  5:12 [PATCH v1] drm/xe/ras: Fix invalid health error code Raag Jadav
2026-08-04  5:23 ` ✓ CI.KUnit: success for " Patchwork
2026-08-04  6:36 ` [PATCH v1] " Tauro, Riana
2026-08-04  6:56   ` Michal Wajdeczko
2026-08-04  8:07     ` Raag Jadav
2026-08-04  8:31       ` Tauro, Riana
2026-08-04 10:16         ` Raag Jadav [this message]
2026-08-04  6:41 ` ✓ Xe.CI.FULL: success for " Patchwork
2026-08-04 13:37 ` ✓ CI.KUnit: " Patchwork
2026-08-05  5:58 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-08-05  8:25 ` ✓ CI.KUnit: success for drm/xe/ras: Fix invalid health error code (rev2) Patchwork
2026-08-05  9:32 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-08-05 16:34 ` ✓ Xe.CI.FULL: success " 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=anG7_k5P3DJezk8n@black.igk.intel.com \
    --to=raag.jadav@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=riana.tauro@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