]> git.baikalelectronics.ru Git - kernel.git/commit
dma-fence: Simply wrap dma_fence_signal_locked with dma_fence_signal
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 17 Aug 2019 15:23:00 +0000 (16:23 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Sat, 17 Aug 2019 17:03:12 +0000 (18:03 +0100)
commitca125789e49f75e86fa6c017fd2a7aa7aea78eda
tree41823e739112cb2030b60cf9b5d6cf3e814017dc
parent8ce68f7cd1f0b242a2448a1104c9aebb527040c7
dma-fence: Simply wrap dma_fence_signal_locked with dma_fence_signal

Currently dma_fence_signal() tries to avoid the spinlock and only takes
it if absolutely required to walk the callback list. However, to allow
for some users to surreptitiously insert lazy signal callbacks that
do not depend on enabling the signaling mechanism around every fence,
we always need to notify the callbacks on signaling. As such, we will
always need to take the spinlock and dma_fence_signal() effectively
becomes a clone of dma_fence_signal_locked().

v2: Update the test_and_set_bit() before entering the spinlock.
v3: Drop the test_[and_set]_bit() before the spinlock, it's a caller
error so expected to be very unlikely.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Christian König <christian.koenig@amd.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Christian König <christian.koenig@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190817152300.5370-1-chris@chris-wilson.co.uk
drivers/dma-buf/dma-fence.c