All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe: Initialize freq_lock even with skip_guc_pc
@ 2024-01-12 18:29 Matt Roper
  2024-01-12 18:55 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Matt Roper @ 2024-01-12 18:29 UTC (permalink / raw)
  To: intel-xe; +Cc: matthew.d.roper, Rodrigo Vivi

gucpc isn't initialized when skip_guc_pc is used, but some of the sysfs
frequency entries still try to grab the uninitialized frequency mutex
before realizing that they need to bail out.  Tweak the init/fini code
flows so that the mutex is always initialized properly.

Fixes: 975e4a3795d4 ("drm/xe: Manually setup C6 when skip_guc_pc is set")
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_pc.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_pc.c b/drivers/gpu/drm/xe/xe_guc_pc.c
index f71085228cb3..67ce24fae79d 100644
--- a/drivers/gpu/drm/xe/xe_guc_pc.c
+++ b/drivers/gpu/drm/xe/xe_guc_pc.c
@@ -964,11 +964,12 @@ void xe_guc_pc_fini(struct xe_guc_pc *pc)
 
 	if (xe->info.skip_guc_pc) {
 		xe_gt_idle_disable_c6(pc_to_gt(pc));
-		return;
+		goto out;
 	}
 
 	XE_WARN_ON(xe_guc_pc_gucrc_disable(pc));
 	XE_WARN_ON(xe_guc_pc_stop(pc));
+out:
 	mutex_destroy(&pc->freq_lock);
 }
 
@@ -984,11 +985,11 @@ int xe_guc_pc_init(struct xe_guc_pc *pc)
 	struct xe_bo *bo;
 	u32 size = PAGE_ALIGN(sizeof(struct slpc_shared_data));
 
-	if (xe->info.skip_guc_pc)
-		return 0;
-
 	mutex_init(&pc->freq_lock);
 
+	if (xe->info.skip_guc_pc)
+		return 0;
+
 	bo = xe_managed_bo_create_pin_map(xe, tile, size,
 					  XE_BO_CREATE_VRAM_IF_DGFX(tile) |
 					  XE_BO_CREATE_GGTT_BIT);
-- 
2.43.0


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

end of thread, other threads:[~2024-01-12 21:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-12 18:29 [PATCH] drm/xe: Initialize freq_lock even with skip_guc_pc Matt Roper
2024-01-12 18:55 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-12 18:55 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-12 18:56 ` ✓ CI.KUnit: success " Patchwork
2024-01-12 19:03 ` ✓ CI.Build: " Patchwork
2024-01-12 19:04 ` ✓ CI.Hooks: " Patchwork
2024-01-12 19:05 ` ✓ CI.checksparse: " Patchwork
2024-01-12 19:28 ` ✓ CI.BAT: " Patchwork
2024-01-12 21:10 ` [PATCH] " Rodrigo Vivi
2024-01-12 21:16   ` Belgaumkar, Vinay
2024-01-12 21:33     ` Matt Roper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.