Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>,
	jani.nikula@intel.com, intel-xe@lists.freedesktop.org,
	riana.tauro@intel.com, matthew.brost@intel.com,
	michal.wajdeczko@intel.com, badal.nilawar@intel.com,
	ville.syrjala@linux.intel.com, karthik.poosa@intel.com,
	anshuman.gupta@intel.com
Subject: Re: [PATCH v1 1/4] drm/xe/pcode: Introduce xe_pcode_read_probe()
Date: Fri, 21 Nov 2025 09:33:37 +0100	[thread overview]
Message-ID: <aSAj4aAKMH_isOvJ@black.igk.intel.com> (raw)
In-Reply-To: <wcfsfjjncwfb5mwjkdixeqvmjvtfnr6vzx7bpwwu6jrbhoal24@orkpmm6x6nbh>

On Thu, Nov 20, 2025 at 09:02:29AM -0600, Lucas De Marchi wrote:
> On Tue, Nov 18, 2025 at 04:38:46PM +0100, Raag Jadav wrote:
> > > > +int xe_pcode_read_probe(struct xe_tile *tile, u32 mbox, u32 *val, u32 *val1);
> > > 
> > > Is "probe" the right condition? I mean, the right name for the exported function?
> > > 
> > > The caller is deciding to downgrade the Illegal command from error to debug, but
> > > is it because it is in the probe? Or because we know that most of FW out there
> > > might not have this command yet and driver knows that and will handle the
> > > lack of backward compatibility properly... in a way that this is not an error.
> > > 
> > > But is this 'probe' ?!
> > 
> > This is following Ville's original comment[1] as in 'probing' for something
> > that may or may not exist.
> > 
> > [1] https://lore.kernel.org/intel-xe/aQ3xItyGMVnKdzoi@intel.com/
> > 
> > > I'm bad with naming as well, so asking help from AI:
> > > 
> > > Alternative naming ideas:
> > > xe_pcode_read_optional
> > > (Indicates the command is optional and failure is acceptable.)
> > > xe_pcode_read_safe
> > > (Suggests a safe read that won't break if unsupported.)
> > > xe_pcode_read_tolerant
> > > (Highlights tolerance for missing command.)
> > > xe_pcode_try_read
> > > (Common pattern for non-fatal attempts.)
> > > xe_pcode_read_if_supported
> > > (Explicit about conditional support.)
> > 
> > I don't even begin to qualify here so it's upto you all.
> 
> xe_pcode_read_if_supported() would be ok IMO, documenting it to mask
> not-supported errors.
> 
> But the the way this is implemented with the extra flag seems weird.
> By "having the caller check" I think it's about handling
> the return code from this function and treating it as a fatal or normal
> case depending on the command being sent, if there's a fallback etc.
> This patch seems to add a function and not used it, but I may be missing
> something.

Forgot to doc. I had an impression that -ENXIO could be used for the
fallback since we already have it here but ...

> I'd rather have this:
> 
> 1) Caller should handle errors and treat it as fatal or normal,
>    depending on having a fallback or not. Emit an err there if
>    appropriate rather than here. It seems we are already emitting
>    additional dbgs in the caller for when pcode_read fails
> 
> 2) What is the command/subcommand triggering this error? We could have a
>    helper like xe_pcode_strerr() that users could call if needed (but
>    then we'd need to return the undecoded error), or we could change
>    this specific return code to -ENOTSUPP.

... converting to -ENOTSUPP makes much more sense, considering the undecoded
return will be inconsistent with other pcode helpers.

>    Is the error we are seeing the latebind from drivers/gpu/drm/xe/xe_late_bind_fw.c?

The errors are from all over but the one currently on fire is the hwmon.

Raag

  reply	other threads:[~2025-11-21  8:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-18  8:59 [PATCH v1 0/4] Introduce xe_pcode_read_probe() Raag Jadav
2025-11-18  8:59 ` [PATCH v1 1/4] drm/xe/pcode: " Raag Jadav
2025-11-18 13:42   ` Rodrigo Vivi
2025-11-18 15:38     ` Raag Jadav
2025-11-18 15:47       ` Rodrigo Vivi
2025-11-20 15:02       ` Lucas De Marchi
2025-11-21  8:33         ` Raag Jadav [this message]
2025-11-25  5:04           ` Raag Jadav
2025-11-25 17:41             ` Rodrigo Vivi
2025-11-27  4:51               ` Raag Jadav
2025-12-01  5:06                 ` Raag Jadav
2025-11-18 19:38   ` Michal Wajdeczko
2025-11-18  8:59 ` [PATCH v1 2/4] drm/xe/sysfs: Use xe_pcode_read_probe() to check for mailbox command support Raag Jadav
2025-11-18  8:59 ` [PATCH v1 3/4] drm/xe/hwmon: " Raag Jadav
2025-11-18  8:59 ` [PATCH v1 4/4] drm/xe/late_bind: " Raag Jadav
2025-11-18  9:09 ` ✓ CI.KUnit: success for Introduce xe_pcode_read_probe() Patchwork
2025-11-18  9:47 ` ✓ Xe.CI.BAT: " Patchwork
2025-11-18 11:56 ` ✗ 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=aSAj4aAKMH_isOvJ@black.igk.intel.com \
    --to=raag.jadav@intel.com \
    --cc=anshuman.gupta@intel.com \
    --cc=badal.nilawar@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=karthik.poosa@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=michal.wajdeczko@intel.com \
    --cc=riana.tauro@intel.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=ville.syrjala@linux.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