Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu/userq: amdgpu_userq_vm_validate does not need userq mutex

amdgpu_userq_vm_validate function does not need userq_mutex and exec
lock is good enough to locking all bos and updating the eviction fence.

Also since we only need userq_mutex for amdgpu_userq_restore_all
so move the locks in the function itself.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Sunil Khatri and committed by
Alex Deucher
de95eda0 de1ef4ff

+5 -5
+5 -5
drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c
··· 1004 1004 unsigned long queue_id; 1005 1005 int ret = 0, r; 1006 1006 1007 + mutex_lock(&uq_mgr->userq_mutex); 1007 1008 /* Resume all the queues for this process */ 1008 1009 xa_for_each(&uq_mgr->userq_xa, queue_id, queue) { 1009 1010 ··· 1020 1019 ret = r; 1021 1020 1022 1021 } 1022 + mutex_unlock(&uq_mgr->userq_mutex); 1023 1023 1024 1024 if (ret) 1025 1025 drm_file_err(uq_mgr->file, "Failed to map all the queues\n"); ··· 1224 1222 struct dma_fence *ev_fence; 1225 1223 int ret; 1226 1224 1227 - mutex_lock(&uq_mgr->userq_mutex); 1228 1225 ev_fence = amdgpu_evf_mgr_get_fence(&fpriv->evf_mgr); 1229 1226 if (!dma_fence_is_signaled(ev_fence)) 1230 - goto unlock; 1227 + goto put_fence; 1231 1228 1232 1229 ret = amdgpu_userq_vm_validate(uq_mgr); 1233 1230 if (ret) { 1234 1231 drm_file_err(uq_mgr->file, "Failed to validate BOs to restore\n"); 1235 - goto unlock; 1232 + goto put_fence; 1236 1233 } 1237 1234 1238 1235 ret = amdgpu_userq_restore_all(uq_mgr); 1239 1236 if (ret) 1240 1237 drm_file_err(uq_mgr->file, "Failed to restore all queues\n"); 1241 1238 1242 - unlock: 1243 - mutex_unlock(&uq_mgr->userq_mutex); 1239 + put_fence: 1244 1240 dma_fence_put(ev_fence); 1245 1241 } 1246 1242