Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/xe/guc: Use drm_device-managed version of mutex_init()
@ 2024-04-06 14:39 Michal Wajdeczko
  2024-04-06 14:39 ` [PATCH 2/2] drm/xe/guc: Initialize GuC ID manager sooner Michal Wajdeczko
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Michal Wajdeczko @ 2024-04-06 14:39 UTC (permalink / raw)
  To: intel-xe; +Cc: Michal Wajdeczko, Matthew Brost

This is safer approach and will help resolve a cleanup ordering
conflict related to the GuC ID manager.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_submit.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_submit.c b/drivers/gpu/drm/xe/xe_guc_submit.c
index 9c30bd9ac8c0..4c444fddfba6 100644
--- a/drivers/gpu/drm/xe/xe_guc_submit.c
+++ b/drivers/gpu/drm/xe/xe_guc_submit.c
@@ -238,7 +238,6 @@ static void guc_submit_fini(struct drm_device *drm, void *arg)
 
 	xa_destroy(&guc->submission_state.exec_queue_lookup);
 	free_submit_wq(guc);
-	mutex_destroy(&guc->submission_state.lock);
 }
 
 static const struct xe_exec_queue_ops guc_exec_queue_ops;
@@ -263,13 +262,16 @@ int xe_guc_submit_init(struct xe_guc *guc)
 	struct xe_gt *gt = guc_to_gt(guc);
 	int err;
 
+	err = drmm_mutex_init(&xe->drm, &guc->submission_state.lock);
+	if (err)
+		return err;
+
 	err = alloc_submit_wq(guc);
 	if (err)
 		return err;
 
 	gt->exec_queue_ops = &guc_exec_queue_ops;
 
-	mutex_init(&guc->submission_state.lock);
 	xa_init(&guc->submission_state.exec_queue_lookup);
 
 	spin_lock_init(&guc->submission_state.suspend.lock);
-- 
2.43.0


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

end of thread, other threads:[~2024-04-08  9:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-06 14:39 [PATCH 1/2] drm/xe/guc: Use drm_device-managed version of mutex_init() Michal Wajdeczko
2024-04-06 14:39 ` [PATCH 2/2] drm/xe/guc: Initialize GuC ID manager sooner Michal Wajdeczko
2024-04-06 18:24   ` Matthew Brost
2024-04-06 14:46 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm/xe/guc: Use drm_device-managed version of mutex_init() Patchwork
2024-04-06 14:46 ` ✓ CI.checkpatch: " Patchwork
2024-04-06 14:47 ` ✓ CI.KUnit: " Patchwork
2024-04-06 14:58 ` ✓ CI.Build: " Patchwork
2024-04-06 15:01 ` ✓ CI.Hooks: " Patchwork
2024-04-06 15:02 ` ✓ CI.checksparse: " Patchwork
2024-04-06 15:29 ` ✗ CI.BAT: failure " Patchwork
2024-04-08  9:19   ` Michal Wajdeczko
2024-04-06 18:23 ` [PATCH 1/2] " Matthew Brost

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