Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Summers, Stuart" <stuart.summers@intel.com>
To: "Jadav, Raag" <raag.jadav@intel.com>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Vivi,  Rodrigo" <rodrigo.vivi@intel.com>,
	"Roper, Matthew D" <matthew.d.roper@intel.com>,
	"De Marchi, Lucas" <lucas.demarchi@intel.com>,
	"Wajdeczko, Michal" <Michal.Wajdeczko@intel.com>
Subject: Re: [PATCH v1] drm/xe: Don't expose device attributes for VFs
Date: Mon, 14 Jul 2025 15:30:54 +0000	[thread overview]
Message-ID: <555ca90e14209445dd5ced8f95ce729fe9b2fda4.camel@intel.com> (raw)
In-Reply-To: <aHHHTOdaSAUdNGkq@black.fi.intel.com>

On Sat, 2025-07-12 at 05:24 +0300, Raag Jadav wrote:
> On Sat, Jul 12, 2025 at 02:19:50AM +0530, Summers, Stuart wrote:
> > On Sat, 2025-07-12 at 00:38 +0530, Raag Jadav wrote:
> > > Commit a7f87deac229 ("drm/xe: Default auto_link_downgrade status
> > > to
> > > false")
> > > tried to fix the side effect of xe_pcode_read() returning
> > > successfully
> > > without valid data-out value when xe->info.skip_pcode is set.
> > > Since
> > > this
> > > is true for IS_SRIOV_VF() cases, a much robust fix would be to
> > > not
> > > expose
> > > device attributes for VFs, which covers wider pcode mailbox
> > > users.
> > 
> > I'm not fully understanding your reasoning here. Why can't we just
> > use
> > a check against skip_pcode in that case? VF might be the main user
> > there, but it isn't inconceivable that we will use that in other
> > scenarios too and then hit a similar problem of accessing an
> > uninitialized variable.
> 
> This also covers non-mailbox attributes which would be unusable for
> VFs.
> So we can either fix the commit message or use skip_pcode check
> against
> mailbox attributes, whichever makes more sense.

Can you add both skip_pcode and IS_SRIOV_VF to the check because these
really are independent cases.

Thanks,
Stuart

> 
> Raag
> 
> > > Fixes: a7f87deac229 ("drm/xe: Default auto_link_downgrade status
> > > to
> > > false")
> > > Signed-off-by: Raag Jadav <raag.jadav@intel.com>
> > > ---
> > >  drivers/gpu/drm/xe/xe_device_sysfs.c | 6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c
> > > b/drivers/gpu/drm/xe/xe_device_sysfs.c
> > > index e5fd0cd537bc..8250aa4620ee 100644
> > > --- a/drivers/gpu/drm/xe/xe_device_sysfs.c
> > > +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
> > > @@ -259,8 +259,7 @@ auto_link_downgrade_status_show(struct device
> > > *dev, struct device_attribute *att
> > >  {
> > >         struct pci_dev *pdev = to_pci_dev(dev);
> > >         struct xe_device *xe = pdev_to_xe_device(pdev);
> > > -       /* default the auto_link_downgrade status to 0 */
> > > -       u32 val = 0;
> > > +       u32 val;
> > >         int ret;
> > >  
> > >         xe_pm_runtime_get(xe);
> > > @@ -297,6 +296,9 @@ int xe_device_sysfs_init(struct xe_device
> > > *xe)
> > >         struct device *dev = xe->drm.dev;
> > >         int ret;
> > >  
> > > +       if (IS_SRIOV_VF(xe))
> > > +               return 0;
> > > +
> > >         if (xe->d3cold.capable) {
> > >                 ret = sysfs_create_file(&dev->kobj,
> > > &dev_attr_vram_d3cold_threshold.attr);
> > >                 if (ret)
> > 


  reply	other threads:[~2025-07-14 15:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-11 19:08 [PATCH v1] drm/xe: Don't expose device attributes for VFs Raag Jadav
2025-07-11 19:15 ` ✓ CI.KUnit: success for " Patchwork
2025-07-11 20:07 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-11 20:49 ` [PATCH v1] " Summers, Stuart
2025-07-12  2:24   ` Raag Jadav
2025-07-14 15:30     ` Summers, Stuart [this message]
2025-07-15  3:55       ` Raag Jadav
2025-07-12  6:14 ` ✗ Xe.CI.Full: failure for " 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=555ca90e14209445dd5ced8f95ce729fe9b2fda4.camel@intel.com \
    --to=stuart.summers@intel.com \
    --cc=Michal.Wajdeczko@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    --cc=matthew.d.roper@intel.com \
    --cc=raag.jadav@intel.com \
    --cc=rodrigo.vivi@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