]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dma-buf/dma-fence: Add dma_fence_check_and_signal()
authorPhilipp Stanner <phasta@kernel.org>
Mon, 1 Dec 2025 10:50:06 +0000 (11:50 +0100)
committerPhilipp Stanner <phasta@kernel.org>
Thu, 4 Dec 2025 14:03:40 +0000 (15:03 +0100)
commitc891b99d25ddbb6b8167f9bdb904d4abc5a53b6b
tree560d440940aab82ecae526d501febdedf3f1c133
parente58b4dea9054c85688c8f639ebdfc8115261dae2
dma-buf/dma-fence: Add dma_fence_check_and_signal()

The overwhelming majority of users of dma_fence signaling functions
don't care about whether the fence had already been signaled by someone
else. Therefore, the return code shall be removed from those functions.

For the few users who rely on the check, a new, specialized function
shall be provided.

Add dma_fence_check_and_signal(), which signals a fence if it had not
yet been signaled, and informs the user about that.

Add a counter part, dma_fence_check_and_signal_locked(), which doesn't
take the spinlock.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patch.msgid.link/20251201105011.19386-4-phasta@kernel.org
drivers/dma-buf/dma-fence.c
include/linux/dma-fence.h