* [PATCH] drm/radeon: delete radeon_fence_process in is_signaled, no deadlock
@ 2025-11-16 17:33 Robert McClinton
2025-11-17 19:38 ` Alex Deucher
0 siblings, 1 reply; 2+ messages in thread
From: Robert McClinton @ 2025-11-16 17:33 UTC (permalink / raw)
To: amd-gfx; +Cc: Robert McClinton, Alex Deucher, stable
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 <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Robert McClinton <rbmccav@gmail.com>
---
drivers/gpu/drm/radeon/radeon_fence.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index 5b5b54e876d4..167d6f122b8e 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/radeon: delete radeon_fence_process in is_signaled, no deadlock
2025-11-16 17:33 [PATCH] drm/radeon: delete radeon_fence_process in is_signaled, no deadlock Robert McClinton
@ 2025-11-17 19:38 ` Alex Deucher
0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2025-11-17 19:38 UTC (permalink / raw)
To: Robert McClinton; +Cc: amd-gfx, Alex Deucher, stable
Applied. Thanks!
Alex
On Mon, Nov 17, 2025 at 3:42 AM Robert McClinton <rbmccav@gmail.com> wrote:
>
> 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 <alexander.deucher@amd.com>
> Cc: stable@vger.kernel.org
> Signed-off-by: Robert McClinton <rbmccav@gmail.com>
> ---
> drivers/gpu/drm/radeon/radeon_fence.c | 7 -------
> 1 file changed, 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
> index 5b5b54e876d4..167d6f122b8e 100644
> --- a/drivers/gpu/drm/radeon/radeon_fence.c
> +++ b/drivers/gpu/drm/radeon/radeon_fence.c
> @@ -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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-17 19:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-16 17:33 [PATCH] drm/radeon: delete radeon_fence_process in is_signaled, no deadlock Robert McClinton
2025-11-17 19:38 ` Alex Deucher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox