diff options
author | Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> | 2024-03-21 12:55:12 -0700 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2024-05-09 09:40:59 -0500 |
commit | 7bd9c9f962eb36d5b88bbe4108d368aad3500c05 (patch) | |
tree | a8f48ea3a2e3e0390773815572a4eda6ead5f233 | |
parent | 2d4b74a619de70e1b87683fa2fa23affa5315f7f (diff) | |
download | linux-stable-7bd9c9f962eb36d5b88bbe4108d368aad3500c05.tar.gz linux-stable-7bd9c9f962eb36d5b88bbe4108d368aad3500c05.tar.bz2 linux-stable-7bd9c9f962eb36d5b88bbe4108d368aad3500c05.zip |
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: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240321195512.274210-1-daniele.ceraolospurio@intel.com
(cherry picked from commit b4abeb5545bb3ddcdda3c19067680ad0b2259be4)
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
-rw-r--r-- | drivers/gpu/drm/xe/xe_guc_ct.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_ct.c b/drivers/gpu/drm/xe/xe_guc_ct.c index 7f32547f94b2..c62dbd6420db 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(), |