]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
amd/amdkfd: Use dma_fence_check_and_signal()
authorPhilipp Stanner <phasta@kernel.org>
Mon, 1 Dec 2025 10:50:07 +0000 (11:50 +0100)
committerPhilipp Stanner <phasta@kernel.org>
Thu, 4 Dec 2025 14:03:40 +0000 (15:03 +0100)
amdkfd is one of the few users which relies on the return code of
dma_fence_signal(), which, so far, informs the caller whether the fence
had already been signaled.

As there are barely any users, dma_fence signaling functions shall get
the return value void. To do so, the few users must be ported to a
function which preserves the old behavior.

Replace the call to dma_fence_signal() with one to
dma_fence_check_and_signal().

Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patch.msgid.link/20251201105011.19386-5-phasta@kernel.org
drivers/gpu/drm/amd/amdkfd/kfd_process.c

index a085faac9fe1a4f5f59493cf667a260a05f84f87..bb252ec437330c9a9a71b803d1396e025ec4b09f 100644 (file)
@@ -1987,10 +1987,10 @@ kfd_process_gpuid_from_node(struct kfd_process *p, struct kfd_node *node,
        return -EINVAL;
 }
 
-static int signal_eviction_fence(struct kfd_process *p)
+static bool signal_eviction_fence(struct kfd_process *p)
 {
        struct dma_fence *ef;
-       int ret;
+       bool ret;
 
        rcu_read_lock();
        ef = dma_fence_get_rcu_safe(&p->ef);
@@ -1998,7 +1998,7 @@ static int signal_eviction_fence(struct kfd_process *p)
        if (!ef)
                return -EINVAL;
 
-       ret = dma_fence_signal(ef);
+       ret = dma_fence_check_and_signal(ef);
        dma_fence_put(ef);
 
        return ret;