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: lock the eviction fence for wq signals it

Lock and refer to the eviction fence before the eviction fence
schedules work queue tries to signal it.

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Arvind Yadav <Arvind.Yadav@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Prike Liang and committed by
Alex Deucher
b2c11e27 eed6a6b2

+10 -1
+10 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
··· 108 108 struct amdgpu_eviction_fence *ev_fence; 109 109 110 110 mutex_lock(&uq_mgr->userq_mutex); 111 + spin_lock(&evf_mgr->ev_fence_lock); 111 112 ev_fence = evf_mgr->ev_fence; 112 - if (!ev_fence) 113 + if (ev_fence) 114 + dma_fence_get(&ev_fence->base); 115 + else 113 116 goto unlock; 117 + spin_unlock(&evf_mgr->ev_fence_lock); 114 118 115 119 amdgpu_userq_evict(uq_mgr, ev_fence); 116 120 121 + mutex_unlock(&uq_mgr->userq_mutex); 122 + dma_fence_put(&ev_fence->base); 123 + return; 124 + 117 125 unlock: 126 + spin_unlock(&evf_mgr->ev_fence_lock); 118 127 mutex_unlock(&uq_mgr->userq_mutex); 119 128 } 120 129