Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/guc: Check error code when initializing the CT mutex
@ 2024-03-21 19:55 Daniele Ceraolo Spurio
  2024-03-21 22:29 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Daniele Ceraolo Spurio @ 2024-03-21 19:55 UTC (permalink / raw)
  To: intel-xe; +Cc: Daniele Ceraolo Spurio

The initialization via drmm_mutex_init can fail, so we need to check the
return code and escalate the failure.

The mutex initialization has been moved after all the other init steps
that can't fail, so we're always guaranteed to have those done and don't
have to check in the cleanup code.

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
---
 drivers/gpu/drm/xe/xe_guc_ct.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c
index d9fa81900ff5..1d930a8eeeca 100644
--- a/drivers/gpu/drm/xe/xe_guc_ct.c
+++ b/drivers/gpu/drm/xe/xe_guc_ct.c
@@ -145,13 +145,16 @@ int xe_guc_ct_init(struct xe_guc_ct *ct)
 
 	xe_assert(xe, !(guc_ct_size() % PAGE_SIZE));
 
-	drmm_mutex_init(&xe->drm, &ct->lock);
 	spin_lock_init(&ct->fast_lock);
 	xa_init(&ct->fence_lookup);
 	INIT_WORK(&ct->g2h_worker, g2h_worker_func);
 	init_waitqueue_head(&ct->wq);
 	init_waitqueue_head(&ct->g2h_fence_wq);
 
+	err = drmm_mutex_init(&xe->drm, &ct->lock);
+	if (err)
+		return err;
+
 	primelockdep(ct);
 
 	bo = xe_managed_bo_create_pin_map(xe, tile, guc_ct_size(),
-- 
2.43.0


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

end of thread, other threads:[~2024-03-22 17:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-21 19:55 [PATCH] drm/xe/guc: Check error code when initializing the CT mutex Daniele Ceraolo Spurio
2024-03-21 22:29 ` ✓ CI.Patch_applied: success for " Patchwork
2024-03-21 22:29 ` ✓ CI.checkpatch: " Patchwork
2024-03-21 22:30 ` ✓ CI.KUnit: " Patchwork
2024-03-21 22:41 ` ✓ CI.Build: " Patchwork
2024-03-21 22:43 ` ✓ CI.Hooks: " Patchwork
2024-03-21 22:45 ` ✓ CI.checksparse: " Patchwork
2024-03-21 23:08 ` ✓ CI.BAT: " Patchwork
2024-03-22 17:00 ` [PATCH] " Belgaumkar, Vinay

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