]> git.baikalelectronics.ru Git - kernel.git/commit
dma-fence: Serialise signal enabling (dma_fence_enable_sw_signaling)
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 4 Oct 2019 10:11:40 +0000 (11:11 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 4 Oct 2019 10:43:45 +0000 (11:43 +0100)
commit1b6513f83ead9e0c2ff7792bbe907f8b19936142
tree4458262a321fc98ac62db85d30b57dae0648b9e1
parente48e858f019a984f1654820c857ce698a0533b1d
dma-fence: Serialise signal enabling (dma_fence_enable_sw_signaling)

Make dma_fence_enable_sw_signaling() behave like its
dma_fence_add_callback() and dma_fence_default_wait() counterparts and
perform the test to enable signaling under the fence->lock, along with
the action to do so. This ensure that should an implementation be trying
to flush the cb_list (by signaling) on retirement before freeing the
fence, it can do so in a race-free manner.

See also ca125789e49f ("dma-fence: Simply wrap dma_fence_signal_locked
with dma_fence_signal").

v2: Refactor all 3 enable_signaling paths to use a common function.
v3: Don't argue, just keep the tracepoint in the existing spot.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191004101140.32713-1-chris@chris-wilson.co.uk
drivers/dma-buf/dma-fence.c