drm/xe/guc: Check error code when initializing the CT mutex

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: default avatarDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: default avatarVinay Belgaumkar <vinay.belgaumkar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240321195512.274210-1-daniele.ceraolospurio@intel.com
parent c04b8aae
...@@ -145,13 +145,16 @@ int xe_guc_ct_init(struct xe_guc_ct *ct) ...@@ -145,13 +145,16 @@ int xe_guc_ct_init(struct xe_guc_ct *ct)
xe_assert(xe, !(guc_ct_size() % PAGE_SIZE)); xe_assert(xe, !(guc_ct_size() % PAGE_SIZE));
drmm_mutex_init(&xe->drm, &ct->lock);
spin_lock_init(&ct->fast_lock); spin_lock_init(&ct->fast_lock);
xa_init(&ct->fence_lookup); xa_init(&ct->fence_lookup);
INIT_WORK(&ct->g2h_worker, g2h_worker_func); INIT_WORK(&ct->g2h_worker, g2h_worker_func);
init_waitqueue_head(&ct->wq); init_waitqueue_head(&ct->wq);
init_waitqueue_head(&ct->g2h_fence_wq); init_waitqueue_head(&ct->g2h_fence_wq);
err = drmm_mutex_init(&xe->drm, &ct->lock);
if (err)
return err;
primelockdep(ct); primelockdep(ct);
bo = xe_managed_bo_create_pin_map(xe, tile, guc_ct_size(), bo = xe_managed_bo_create_pin_map(xe, tile, guc_ct_size(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment