Skip to contentSkip to conversation

drm/radeon: delete radeon_fence_process in is_signaled, no deadlock

PATCH Applied Robert McClinton 2 participants 2 messages Nov 16, 2025 – Nov 17, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/radeon: delete radeon_fence_process in is_signaled, no deadlock

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.

---
 drivers/gpu/drm/radeon/radeon_fence.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/gpu/drm/radeon/radeon_fence.c +0 -7
index 5b5b54e876d4..167d6f122b8e 100644
@@ -360,13 +360,6 @@ static bool radeon_fence_is_signaled(struct dma_fence *f)
 	if (atomic64_read(&rdev->fence_drv[ring].last_seq) >= seq)
 		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;
 }
 
Signature · 1 line
2.51.2
Applied
#1 lore raw

Applied. Thanks!

Alex

Quoted 42 lines · Robert McClinton

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.

---
 drivers/gpu/drm/radeon/radeon_fence.c | 7 -------
 1 file changed, 7 deletions(-)
drivers/gpu/drm/radeon/radeon_fence.c +0 -8
index 5b5b54e876d4..167d6f122b8e 100644
@@ -360,13 +360,6 @@ static bool radeon_fence_is_signaled(struct dma_fence *f)
        if (atomic64_read(&rdev->fence_drv[ring].last_seq) >= seq)
                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.51.2