All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Cavitt, Jonathan" <jonathan.cavitt@intel.com>
Cc: "Jadav, Raag" <raag.jadav@intel.com>,
	"De Marchi, Lucas" <lucas.demarchi@intel.com>,
	"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Brost, Matthew" <matthew.brost@intel.com>,
	 "Summers, Stuart" <stuart.summers@intel.com>,
	"Ceraolo Spurio, Daniele" <daniele.ceraolospurio@intel.com>,
	"Belgaumkar, Vinay" <vinay.belgaumkar@intel.com>
Subject: Re: [PATCH v2] drm/xe: Don't fail probe on unsupported mailbox command
Date: Tue, 15 Jul 2025 15:30:50 -0400	[thread overview]
Message-ID: <aHasarUENIsby3D4@intel.com> (raw)
In-Reply-To: <CH0PR11MB54446B46579C1A88384DE2DDE554A@CH0PR11MB5444.namprd11.prod.outlook.com>

On Mon, Jul 14, 2025 at 06:02:55PM -0400, Cavitt, Jonathan wrote:
> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Raag Jadav
> Sent: Monday, July 14, 2025 2:55 PM
> To: De Marchi, Lucas <lucas.demarchi@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com>
> Cc: intel-xe@lists.freedesktop.org; Brost, Matthew <matthew.brost@intel.com>; Summers, Stuart <stuart.summers@intel.com>; Ceraolo Spurio, Daniele <daniele.ceraolospurio@intel.com>; Belgaumkar, Vinay <vinay.belgaumkar@intel.com>; Jadav, Raag <raag.jadav@intel.com>
> Subject: [PATCH v2] drm/xe: Don't fail probe on unsupported mailbox command
> > 
> > If the device is running older pcode firmware, it is possible that newer
> > mailbox commands are not supported by it. The sysfs attributes aren't
> > useful in that case, but we shouldn't fail driver probe because of it.
> > As of now, it is unknown if we can distinguish unsupported commands before
> > attempting them. But until we figure out a way to do that, fix the
> > regressions.
> > 
> > v2: Add debug message (Lucas)
> > 
> > Fixes: cdc36b66cd41 ("drm/xe: Expose fan control and voltage regulator version")
> > Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> > Tested-by: Matthew Brost <matthew.brost@intel.com>
> > ---
> >  drivers/gpu/drm/xe/xe_device_sysfs.c | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c
> > index 8250aa4620ee..fd2ba0da02a2 100644
> > --- a/drivers/gpu/drm/xe/xe_device_sysfs.c
> > +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
> > @@ -160,8 +160,13 @@ static int late_bind_create_files(struct device *dev)
> >  
> >  	ret = xe_pcode_read(root, PCODE_MBOX(PCODE_LATE_BINDING, GET_CAPABILITY_STATUS, 0),
> >  			    &cap, NULL);
> > -	if (ret)
> > +	if (ret) {
> > +		if (ret == -ENXIO) {
> > +			drm_dbg(&xe->drm, "Late binding not supported by firmware\n");
> > +			ret = 0;
> > +		}
> 
> If we're disarming the error value here, then do we need to 'goto out' after this,
> or can we reenter the standard execution path safely here?  I'm guessing we're
> branching unconditionally because we still detected a failure in this function that
> requires handling, and that we're just masking the report to prevent driver probe
> failures on boot as per the commit message description.
> 
> So, assuming there's a compelling reason we still need to branch here:
> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> -Jonathan Cavitt
> 
> >  		goto out;

                ^ HERE

This code is 'go(ing)to out' right after the error disarming.

For a moment this comment scared me... I had pushed the patch, then I removed with
a force push to be able to look it another time.

There's nothing wrong with this patch, so I pushed it again to drm-xe-next.

(Well, by nothing wrong I mean... I would still prefer something to check the PCODE version
before in a way that the mb command is never submitted to start with, but, let's
live with this fix)

Although it ended up missing the last drm-next pr it will be part of the
-next-fixes flow and still be fixing 6.17 as well.

Thanks,
Rodrigo.

> > +	}
> >  
> >  	if (REG_FIELD_GET(V1_FAN_SUPPORTED, cap)) {
> >  		ret = sysfs_create_file(&dev->kobj, &dev_attr_lb_fan_control_version.attr);
> > -- 
> > 2.34.1
> > 
> > 

  reply	other threads:[~2025-07-15 19:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14 21:55 [PATCH v2] drm/xe: Don't fail probe on unsupported mailbox command Raag Jadav
2025-07-14 22:02 ` ✓ CI.KUnit: success for drm/xe: Don't fail probe on unsupported mailbox command (rev2) Patchwork
2025-07-14 22:02 ` [PATCH v2] drm/xe: Don't fail probe on unsupported mailbox command Cavitt, Jonathan
2025-07-15 19:30   ` Rodrigo Vivi [this message]
2025-07-14 22:55 ` ✓ Xe.CI.BAT: success for drm/xe: Don't fail probe on unsupported mailbox command (rev2) Patchwork
2025-07-15  3:34 ` ✗ 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=aHasarUENIsby3D4@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jonathan.cavitt@intel.com \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=stuart.summers@intel.com \
    --cc=vinay.belgaumkar@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.