dma_fence_wait(9)
π€ NAME π€
okay so bestie, this is dma_fence_wait β the function that will sleep until the fence gets signaled π΄β¨. We're in the Kernel API Manual, and this one is short but important, so pay attention π
.
πΈ SYNOPSIS πΈ
signed long dma_fence_wait (struct dma_fence *fence , bool intr );
π ARGUMENTS π
fenceβ the fence to wait on πintrβ if true, do an interruptible wait β¨
π¦ DESCRIPTION π¦
This function will return -ERESTARTSYS if interrupted by a signal, or 0 if the fence was signaled. Other error values may be returned on custom implementations. π«Ά
It performs a synchronous wait on this fence. It is assumed the caller directly or indirectly holds a reference to the fence, otherwise the fence might be freed before return, resulting in undefined behavior. β οΈ
bestie, this is the part where you do not skip the reference check. If the caller doesn't directly or indirectly hold a reference to the fence, the fence might be freed before return, and that's undefined behavior β the scary kind ππ.
See also dma_fence_wait_timeout and dma_fence_wait_any_timeout. π
π SEE ALSO π
the whole fence friend group showed up, periodt:
- Kernel file
./include/linux/dma-fence.h struct dma_fence(9)struct dma_fence_cb(9)struct dma_fence_ops(9)dma_fence_was_initialized(9)dma_fence_put(9)dma_fence_get(9)dma_fence_get_rcu(9)dma_fence_get_rcu_safe(9)dma_fence_spinlock(9)dma_fence_lock_irqsave(9)dma_fence_unlock_irqrestore(9)dma_fence_assert_held(9)Safe external access to driver provided object members(9)dma_fence_is_signaled_locked(9)dma_fence_is_signaled(9)__dma_fence_is_later(9)dma_fence_is_later(9)dma_fence_is_later_or_same(9)dma_fence_later(9)dma_fence_get_status_locked(9)dma_fence_set_error(9)dma_fence_timestamp(9)dma_fence_is_array(9)dma_fence_is_chain(9)dma_fence_is_container(9)
mwah π that's the page! source path ./include/linux, date October 2026, manual page dma_fence_wait(9) β slay and wait responsibly π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms