Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

amd/amdkfd: Use dma_fence_check_and_signal()

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

+3 -3
+3 -3
drivers/gpu/drm/amd/amdkfd/kfd_process.c
··· 1987 1987 return -EINVAL; 1988 1988 } 1989 1989 1990 - static int signal_eviction_fence(struct kfd_process *p) 1990 + static bool signal_eviction_fence(struct kfd_process *p) 1991 1991 { 1992 1992 struct dma_fence *ef; 1993 - int ret; 1993 + bool ret; 1994 1994 1995 1995 rcu_read_lock(); 1996 1996 ef = dma_fence_get_rcu_safe(&p->ef); ··· 1998 1998 if (!ef) 1999 1999 return -EINVAL; 2000 2000 2001 - ret = dma_fence_signal(ef); 2001 + ret = dma_fence_check_and_signal(ef); 2002 2002 dma_fence_put(ef); 2003 2003 2004 2004 return ret;