Commit 583d1fa1 authored by Philipp Stanner's avatar Philipp Stanner
Browse files

dma-buf: Don't misuse dma_fence_signal()



The return code of dma_fence_signal() is not really useful as there is
nothing reasonable to do if a fence was already signaled. That return
code shall be removed from the kernel.

Moreover, dma_fence_signal() should not be used to check whether fences
are signaled. That's what dma_fence_is_signaled() and
dma_fence_test_signaled_flag() exist for.

Replace the non-canonical usage of dma_fence_signal().

Suggested-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarPhilipp Stanner <phasta@kernel.org>
Link: https://patch.msgid.link/20251201105011.19386-7-phasta@kernel.org
parent dbcd754b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ static int test_signaling(void *arg)
		goto err_free;
	}

	if (dma_fence_signal(f)) {
	if (dma_fence_check_and_signal(f)) {
		pr_err("Fence reported being already signaled\n");
		goto err_free;
	}
@@ -136,7 +136,7 @@ static int test_signaling(void *arg)
		goto err_free;
	}

	if (!dma_fence_signal(f)) {
	if (!dma_fence_test_signaled_flag(f)) {
		pr_err("Fence reported not being already signaled\n");
		goto err_free;
	}