[PATCH] drm/xe: Skip creation of pcode sysfs files when pcode is disabled
Raag Jadav
raag.jadav at intel.com
Mon Aug 25 14:48:28 UTC 2025
On Mon, Aug 25, 2025 at 04:31:23PM +0200, Andi Shyti wrote:
> Hi Rodrigo,
>
> On Fri, Aug 22, 2025 at 12:30:02PM -0400, Rodrigo Vivi wrote:
> > On Tue, Aug 19, 2025 at 04:55:29PM -0100, Andi Shyti wrote:
> > > From: Andi Shyti <andi.shyti at linux.intel.com>
> > >
> > > Coverity warns that 'cap' may be used uninitialised. If pcode
> > > is disabled there is no need to go through the hassle of a
> > > pcode read or taking a PM reference.
> >
> > Please mark it as false positive!
>
> this patch is not for fixing the Coverity warning, but I saw it
> useless to step any further if there is skip pcode.
>
> The same check is done later in the function, but in the meantime
> we have done a few things that we could have spared.
I tried something similar a few days ago, but perhaps not very convincingly
I presume.
[1] https://lore.kernel.org/intel-xe/20250806152256.748057-1-raag.jadav@intel.com/
Raag
> > We will only get here for BMG which has pcode for sure.
> >
> > >
> > > Check skip_pcode early in the function and return if it is set.
> > >
> > > No change for platforms where pcode is enabled.
> > >
> > > Signed-off-by: Andi Shyti <andi.shyti at linux.intel.com>
> > > ---
> > > drivers/gpu/drm/xe/xe_device_sysfs.c | 3 +++
> > > 1 file changed, 3 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/xe/xe_device_sysfs.c b/drivers/gpu/drm/xe/xe_device_sysfs.c
> > > index bd9015761aa0..3a083c215891 100644
> > > --- a/drivers/gpu/drm/xe/xe_device_sysfs.c
> > > +++ b/drivers/gpu/drm/xe/xe_device_sysfs.c
> > > @@ -156,6 +156,9 @@ static int late_bind_create_files(struct device *dev)
> > > u32 cap;
> > > int ret;
> > >
> > > + if (xe->info.skip_pcode)
> > > + return 0;
> > > +
> > > xe_pm_runtime_get(xe);
> > >
> > > ret = xe_pcode_read(root, PCODE_MBOX(PCODE_LATE_BINDING, GET_CAPABILITY_STATUS, 0),
> > > --
> > > 2.50.0
> > >
More information about the Intel-xe
mailing list