[COMMON] g2d: fix spinlock lockup for fence
authorhyesoo.yu <hyesoo.yu@samsung.com>
Tue, 20 Jun 2017 06:13:28 +0000 (15:13 +0900)
committerSeungchul Kim <sc377.kim@samsung.com>
Mon, 28 May 2018 05:27:23 +0000 (14:27 +0900)
commit08b3ab10cc1c4caac73dbef159ba8c8f00c21cf8
tree7899df6093acdc8598c9643187c54384f74a05e3
parent2b8cc31882eb63b6f6dd554342afaec0a72062cc
[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