Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

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>
Signed-off-by: Robert McClinton <rbmccav@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Robert McClinton and committed by
Alex Deucher
527ba26e 7203fa78

-7
-7
drivers/gpu/drm/radeon/radeon_fence.c
··· 360 360 if (atomic64_read(&rdev->fence_drv[ring].last_seq) >= seq) 361 361 return true; 362 362 363 - if (down_read_trylock(&rdev->exclusive_lock)) { 364 - radeon_fence_process(rdev, ring); 365 - up_read(&rdev->exclusive_lock); 366 - 367 - if (atomic64_read(&rdev->fence_drv[ring].last_seq) >= seq) 368 - return true; 369 - } 370 363 return false; 371 364 } 372 365