Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Raag Jadav <raag.jadav@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@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: Mon, 1 Dec 2025 06:06:52 +0100	[thread overview]
Message-ID: <aS0ibEIQ1-FB-OHH@black.igk.intel.com> (raw)
In-Reply-To: <aSfYzJdEkOwgays3@black.igk.intel.com>

On Thu, Nov 27, 2025 at 05:51:29AM +0100, Raag Jadav wrote:
> On Tue, Nov 25, 2025 at 12:41:55PM -0500, Rodrigo Vivi wrote:
> > On Tue, Nov 25, 2025 at 06:04:59AM +0100, Raag Jadav wrote:
> > > On Fri, Nov 21, 2025 at 09:33:42AM +0100, Raag Jadav wrote:
> > > > 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:
> > > 
> > > ...
> > > 
> > > > > > > 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.
> > > 
> > > On second thought, looking at it from caller standpoint, I'm wondering why
> > > this shouldn't be the expectation with xe_pcode_read() itself?
> > > 
> > > I'm okay with the new helper but if we're claiming that something happens
> > > *only* if supported, I'd expect it to be the default behaviour instead of
> > > having extra bells and whistles. The only difference here is how the caller
> > > chooses to treat it (-ENOTSUPP) anyway.
> > > 
> > > Thoughts?
> > 
> > It makes sense to me. I'd just peak into the history to see if there was any
> > documented reason for the current code or just some bad decision/judgement
> > from my side when adding that... if so, I'm sorry in advance...
> 
> Don't get me wrong, I still fully believe that we should not let this be
> an excuse for callers to attempt random commands and abuse the mailbox.
> So for now we facilitate the fallback for xe_pcode_read() only and let
> other helpers operate as they are.
> 
> With that we'll also have the flexibility to change the behaviour per
> helper in the future.
> 
> Sound okay?

I was thinking through this over the weekend and came up with another
hack. Hold on for v2.

Raag

  reply	other threads:[~2025-12-01  5:07 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
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 [this message]
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=aS0ibEIQ1-FB-OHH@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