From: Robert McClinton <[email protected]>

[ Upstream commit 9eb00b5f5697bd56baa3222c7a1426fa15bacfb5 ]

Delete the attempt to progress the queue when checking if fence is
signaled. This avoids deadlock.

dma-fence_ops::signaled can be called with the fence lock in unknown
state. For radeon, the fence lock is also the wait queue lock. This can
cause a self deadlock when signaled() tries to make forward progress on
the wait queue. But advancing the queue is unneeded because incorrectly
returning false from signaled() is perfectly acceptable.

Link: https://github.com/brave/brave-browser/issues/49182
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4641
Cc: Alex Deucher <[email protected]>
Signed-off-by: Robert McClinton <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
(cherry picked from commit 527ba26e50ec2ca2be9c7c82f3ad42998a75d0db)
Cc: [email protected]
[ Minor conflict resolved. ]
Signed-off-by: Li hongliang <[email protected]>
---
 drivers/gpu/drm/radeon/radeon_fence.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_fence.c 
b/drivers/gpu/drm/radeon/radeon_fence.c
index 6d5e828fa39e..1462837fda5a 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -362,14 +362,6 @@ static bool radeon_fence_is_signaled(struct dma_fence *f)
                return true;
        }
 
-       if (down_read_trylock(&rdev->exclusive_lock)) {
-               radeon_fence_process(rdev, ring);
-               up_read(&rdev->exclusive_lock);
-
-               if (atomic64_read(&rdev->fence_drv[ring].last_seq) >= seq) {
-                       return true;
-               }
-       }
        return false;
 }
 
-- 
2.34.1


Reply via email to