]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: partially revert "svm bo enable_signal call condition"
authorChristian König <ckoenig.leichtzumerken@gmail.com>
Mon, 22 Nov 2021 12:39:26 +0000 (13:39 +0100)
committerChristian König <christian.koenig@amd.com>
Mon, 22 Nov 2021 20:27:04 +0000 (21:27 +0100)
Partially revert commit 8ff4744f2b6d6455d8bc7d65c06d4933824547a2.

First of all this is illegal use of RCU to call dma_fence_enable_sw_signaling()
since we don't hold a reference to the fence in question and can crash badly.

Then the code doesn't seem to have the intended effect since only the
exclusive fence is handled, but the KFD fences are always added as shared fence.

Only keep the handling to throw away the content of SVM BOs.

Signed-off-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211122123926.385017-1-christian.koenig@amd.com
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

index eab4380f28e54b87475132bbb8aa1257292feb7e..c15687ce67c4b2953a0acaabbfdbf30bdc31d0e6 100644 (file)
@@ -116,17 +116,8 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
 
        abo = ttm_to_amdgpu_bo(bo);
        if (abo->flags & AMDGPU_AMDKFD_CREATE_SVM_BO) {
-               struct dma_fence *fence;
-               struct dma_resv *resv = &bo->base._resv;
-
-               rcu_read_lock();
-               fence = rcu_dereference(resv->fence_excl);
-               if (fence && !fence->ops->signaled)
-                       dma_fence_enable_sw_signaling(fence);
-
                placement->num_placement = 0;
                placement->num_busy_placement = 0;
-               rcu_read_unlock();
                return;
        }