Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/guc: Make creation of SLPC debugfs files conditional
@ 2025-05-15  9:49 Aradhya Bhatia
  2025-05-15  9:54 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Aradhya Bhatia @ 2025-05-15  9:49 UTC (permalink / raw)
  To: Matt Roper
  Cc: Intel XE List, Tejas Upadhyay, Himal Prasad Ghimiray,
	Aradhya Bhatia

Platforms that do not support SLPC are exempted from the GuC PC support.
The GuC PC does not get initialized, and neither do its BOs get created.

This causes a problem because the GuC PC debugfs file is still being
created. Whenever the file is attempted to read, it causes a NULL
pointer dereference on the supposed BO of the GuC PC.

So, make the creation of SLPC debugfs files conditional to when SLPC
features are supported.

Suggested-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Aradhya Bhatia <aradhya.bhatia@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_debugfs.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_debugfs.c b/drivers/gpu/drm/xe/xe_guc_debugfs.c
index f33013f8a0f3..0b102ab46c4d 100644
--- a/drivers/gpu/drm/xe/xe_guc_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_guc_debugfs.c
@@ -113,23 +113,34 @@ static const struct drm_info_list vf_safe_debugfs_list[] = {
 	{ "guc_ctb", .show = guc_debugfs_show, .data = guc_ctb },
 };
 
+/* For GuC debugfs files that require the SLPC support */
+static const struct drm_info_list slpc_debugfs_list[] = {
+	{ "guc_pc", .show = guc_debugfs_show, .data = guc_pc },
+};
+
 /* everything else should be added here */
 static const struct drm_info_list pf_only_debugfs_list[] = {
 	{ "guc_log", .show = guc_debugfs_show, .data = guc_log },
 	{ "guc_log_dmesg", .show = guc_debugfs_show, .data = guc_log_dmesg },
-	{ "guc_pc", .show = guc_debugfs_show, .data = guc_pc },
 };
 
 void xe_guc_debugfs_register(struct xe_guc *guc, struct dentry *parent)
 {
-	struct drm_minor *minor = guc_to_xe(guc)->drm.primary;
+	struct xe_device *xe =  guc_to_xe(guc);
+	struct drm_minor *minor = xe->drm.primary;
 
 	drm_debugfs_create_files(vf_safe_debugfs_list,
 				 ARRAY_SIZE(vf_safe_debugfs_list),
 				 parent, minor);
 
-	if (!IS_SRIOV_VF(guc_to_xe(guc)))
+	if (!IS_SRIOV_VF(xe)) {
 		drm_debugfs_create_files(pf_only_debugfs_list,
 					 ARRAY_SIZE(pf_only_debugfs_list),
 					 parent, minor);
+
+		if (!xe->info.skip_guc_pc)
+			drm_debugfs_create_files(slpc_debugfs_list,
+						 ARRAY_SIZE(slpc_debugfs_list),
+						 parent, minor);
+	}
 }

base-commit: 3d6670fab64cb00b5e6ed80d2517147db533faf1
-- 
2.43.0


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

end of thread, other threads:[~2025-05-16  5:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-15  9:49 [PATCH] drm/xe/guc: Make creation of SLPC debugfs files conditional Aradhya Bhatia
2025-05-15  9:54 ` ✓ CI.Patch_applied: success for " Patchwork
2025-05-15  9:55 ` ✓ CI.checkpatch: " Patchwork
2025-05-15  9:57 ` ✓ CI.KUnit: " Patchwork
2025-05-15 10:07 ` ✓ CI.Build: " Patchwork
2025-05-15 10:09 ` ✓ CI.Hooks: " Patchwork
2025-05-15 10:11 ` ✓ CI.checksparse: " Patchwork
2025-05-15 10:42 ` ✓ Xe.CI.BAT: " Patchwork
2025-05-15 13:16 ` [PATCH] " Upadhyay, Tejas
2025-05-15 17:36   ` Aradhya Bhatia
2025-05-15 18:37     ` Summers, Stuart
2025-05-16  5:07       ` Aradhya Bhatia
2025-05-16  5:42         ` Upadhyay, Tejas
2025-05-15 19:27 ` ✗ Xe.CI.Full: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox