[COMMON] g2d: fix spinlock lockup for fence
authorhyesoo.yu <hyesoo.yu@samsung.com>
Tue, 20 Jun 2017 06:13:28 +0000 (15:13 +0900)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:13 +0000 (20:22 +0300)
commit223a20b9b4664934145a87c5c03e8ccded19025d
tree2aa7cbdd128a73f9c3479fe4af63dbf918b555a1
parent7c96387f1e01aa111bfadf2f9487bdde84f7ae37
[COMMON] g2d: fix spinlock lockup for fence

CPU1 CPU2
spin_lock_irqsave(task->fence_timeout_lock)

fence_signal_locked() /* called with fence->lock held */
g2d_fence_callback()
spin_lock_irqsave(task->fence_timeout_lock)
g2d_fence_timeout_handler()
fence_remove_callback()
spin_lock_irqsave(fence->lock)

On the above condition, two spinlock are deadlocked.

So, move fence_remove_callback() from fence_timeout_lock section.

Change-Id: If023ac94c2130ec0320814f3f2dc638c0031e761
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
drivers/gpu/exynos/g2d/g2d_fence.c