diff options
| author | Alex Deucher <[email protected]> | 2025-04-25 16:07:06 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2025-04-30 22:08:24 +0000 |
| commit | c5e02d6588f2498cf726e13504593f7325f1ee61 (patch) | |
| tree | b58206e638d8607d48d7c30d0c89a4a2b5987d22 /drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | |
| parent | drm/amdgpu: Add DPG pause for VCN v5.0.1 (diff) | |
| download | kernel-c5e02d6588f2498cf726e13504593f7325f1ee61.tar.gz kernel-c5e02d6588f2498cf726e13504593f7325f1ee61.zip | |
drm/amdgpu/userq: take the userq_mgr lock in suspend/resume
Add the missing locking.
Fixes: 73e12e98ec0c ("drm/amdgpu/userq: add suspend and resume helpers")
Reviewed-by: Arvind Yadav <[email protected]>
Reviewed-by: Prike Liang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c index 451890ee3fb7..1fa9d2be87f3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c @@ -809,11 +809,13 @@ int amdgpu_userq_suspend(struct amdgpu_device *adev) mutex_lock(&adev->userq_mutex); list_for_each_entry_safe(uqm, tmp, &adev->userq_mgr_list, list) { cancel_delayed_work_sync(&uqm->resume_work); + mutex_lock(&uqm->userq_mutex); idr_for_each_entry(&uqm->userq_idr, queue, queue_id) { r = amdgpu_userq_unmap_helper(uqm, queue); if (r) ret = r; } + mutex_unlock(&uqm->userq_mutex); } mutex_unlock(&adev->userq_mutex); return ret; @@ -832,11 +834,13 @@ int amdgpu_userq_resume(struct amdgpu_device *adev) mutex_lock(&adev->userq_mutex); list_for_each_entry_safe(uqm, tmp, &adev->userq_mgr_list, list) { + mutex_lock(&uqm->userq_mutex); idr_for_each_entry(&uqm->userq_idr, queue, queue_id) { r = amdgpu_userq_map_helper(uqm, queue); if (r) ret = r; } + mutex_unlock(&uqm->userq_mutex); } mutex_unlock(&adev->userq_mutex); return ret; |
