intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Skip creation of pcode sysfs files when pcode is disabled
@ 2025-08-19 17:55 Andi Shyti
  2025-08-20  2:52 ` ✓ CI.KUnit: success for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Andi Shyti @ 2025-08-19 17:55 UTC (permalink / raw)
  To: intel-xe, dri-devel; +Cc: Raag Jadav, Rodrigo Vivi, Andi Shyti, Andi Shyti

From: Andi Shyti <andi.shyti@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.

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@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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-25 16:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-19 17:55 [PATCH] drm/xe: Skip creation of pcode sysfs files when pcode is disabled Andi Shyti
2025-08-20  2:52 ` ✓ CI.KUnit: success for " Patchwork
2025-08-20  4:06 ` ✓ Xe.CI.BAT: " Patchwork
2025-08-20 23:48 ` ✗ Xe.CI.Full: failure " Patchwork
2025-08-22 16:30 ` [PATCH] " Rodrigo Vivi
2025-08-25 14:31   ` Andi Shyti
2025-08-25 14:48     ` Raag Jadav
2025-08-25 15:26       ` Rodrigo Vivi
2025-08-25 16:11         ` Michal Wajdeczko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).