Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: skip register UC debugfs if UC disabled
@ 2024-01-04 10:05 Ohad Sharabi
  2024-01-04 18:09 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Ohad Sharabi @ 2024-01-04 10:05 UTC (permalink / raw)
  To: intel-xe

When working with execlist we should not register the UC debugfs entries.

Accessing those entries when UC is disabled can lead to a kernel crush
(NULL pointer dereference).

Signed-off-by: Ohad Sharabi <osharabi@habana.ai>
---
 drivers/gpu/drm/xe/xe_gt_debugfs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_gt_debugfs.c b/drivers/gpu/drm/xe/xe_gt_debugfs.c
index c4b67cf09f8f..bafd55a7fb16 100644
--- a/drivers/gpu/drm/xe/xe_gt_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_gt_debugfs.c
@@ -245,5 +245,6 @@ void xe_gt_debugfs_register(struct xe_gt *gt)
 				 ARRAY_SIZE(debugfs_list),
 				 root, minor);
 
-	xe_uc_debugfs_register(&gt->uc, root);
+	if (xe_device_uc_enabled(xe))
+		xe_uc_debugfs_register(&gt->uc, root);
 }
-- 
2.34.1


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

end of thread, other threads:[~2024-02-21  7:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-04 10:05 [PATCH] drm/xe: skip register UC debugfs if UC disabled Ohad Sharabi
2024-01-04 18:09 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-04 18:09 ` ✓ CI.checkpatch: " Patchwork
2024-01-04 18:10 ` ✓ CI.KUnit: " Patchwork
2024-01-04 18:18 ` ✓ CI.Build: " Patchwork
2024-01-04 18:18 ` ✓ CI.Hooks: " Patchwork
2024-01-04 18:20 ` ✓ CI.checksparse: " Patchwork
2024-01-04 18:45 ` [PATCH] " Matthew Brost
2024-01-04 18:57 ` ✓ CI.BAT: success for " Patchwork
2024-02-21  5:57 ` [PATCH] " Lucas De Marchi
2024-02-21  7:28   ` Ohad Sharabi

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