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.

drm/xe: Use dma_fence_check_and_signal_locked()

Xe is one of the few users utilizing the return code of
dma_fence_signal() to check whether a fence had already been signaled by
someone else.

To clean up and simplify the dma_fence API, the few kernel users relying
on that behavior shall be ported to an alternative function.

Replace dma_fence_signal_locked() with
dma_fence_check_and_signal_locked().

Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Link: https://patch.msgid.link/20251201105011.19386-6-phasta@kernel.org

+1 -3
+1 -3
drivers/gpu/drm/xe/xe_hw_fence.c
··· 85 85 { 86 86 struct xe_hw_fence *fence, *next; 87 87 unsigned long flags; 88 - int err; 89 88 bool tmp; 90 89 91 90 if (XE_WARN_ON(!list_empty(&irq->pending))) { ··· 92 93 spin_lock_irqsave(&irq->lock, flags); 93 94 list_for_each_entry_safe(fence, next, &irq->pending, irq_link) { 94 95 list_del_init(&fence->irq_link); 95 - err = dma_fence_signal_locked(&fence->dma); 96 + XE_WARN_ON(dma_fence_check_and_signal_locked(&fence->dma)); 96 97 dma_fence_put(&fence->dma); 97 - XE_WARN_ON(err); 98 98 } 99 99 spin_unlock_irqrestore(&irq->lock, flags); 100 100 dma_fence_end_signalling(tmp);