nouveau_cli_work() contains a section where a dma_fence lock is manually
taken and immediately released afterwards. This was added in

        commit c8a5d5ea3ba6 ("nouveau: fix client work fence deletion race")

as a bugfix because the function dma_fence_is_signaled() could return
true while the fence was still signaling.

The fix was later modified in

        commit a80d12eafad1 ("drm/nouveau: Simplify nouveau_cli_work")

Luckily, the dma_fence backend now fully synchronizes
dma_fence_is_signaled() with the spinlock. Thus, the check in nouveau is
not necessary anymore.

Remove the manual lock-unlock section.

Signed-off-by: Philipp Stanner <[email protected]>
---
 drivers/gpu/drm/nouveau/nouveau_drm.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c 
b/drivers/gpu/drm/nouveau/nouveau_drm.c
index b0f9fb10a74d..74632bb29f2f 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -163,19 +163,6 @@ nouveau_cli_work(struct work_struct *w)
                struct dma_fence *fence = work->fence;
 
                if (!fence || dma_fence_is_signaled(fence)) {
-                       if (fence) {
-                               unsigned long flags;
-
-                               /*
-                                * Because fence can still be in the process of
-                                * processing the callback list, and the
-                                * callback references the work we are about to
-                                * free, we need to sync with the callback
-                                * processing before freeing the work.
-                                */
-                               dma_fence_lock_irqsave(fence, flags);
-                               dma_fence_unlock_irqrestore(fence, flags);
-                       }
                        list_del(&work->head);
                        work->func(work);
                        dma_fence_put(fence);
-- 
2.56.0

Reply via email to