Lock the eviction fence before trying to signal it.

Signed-off-by: Prike Liang <prike.li...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
index 242bfb91c4f7..fed065892568 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_eviction_fence.c
@@ -108,7 +108,9 @@ amdgpu_eviction_fence_suspend_worker(struct work_struct 
*work)
        struct amdgpu_eviction_fence *ev_fence;
 
        mutex_lock(&uq_mgr->userq_mutex);
+       spin_lock(&evf_mgr->ev_fence_lock);
        ev_fence = evf_mgr->ev_fence;
+       spin_unlock(&evf_mgr->ev_fence_lock);
        if (!ev_fence)
                goto unlock;
 
-- 
2.34.1

Reply via email to