dma_fence_wait_timeout(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ dma_fence_wait_timeout(9) ✨

okay so this is a page from the Kernel API Manual β€” yes, the actual kernel docs, we're fancy now πŸ’… β€” and it's about dma_fence_wait_timeout, which is literally the "just sit there and chill until the fence gets signaled" function. bestie, it's giving waiting room energy but make it kernel πŸ”₯


πŸ’– NAME πŸ’–

dma_fence_wait_timeout β€” sleep until the fence gets signaled, or until the timeout elapses 😴⏰

🌸 SYNOPSIS 🌸

signed long dma_fence_wait_timeout (struct dma_fence *fence , bool intr , signed long timeout );

that's the whole vibe check, no cap ✨

πŸŽ€ ARGUMENTS πŸŽ€

  • fence β€” the fence we're waiting on πŸ¦‹ the main character of this whole situation, honestly.
  • intr β€” if true, do an interruptible wait 😭 meaning you can be woken up early, bestie.
  • timeout β€” the timeout value in jiffies, or MAX_SCHEDULE_TIMEOUT ⏳ (iykyk β€” that one means "basically forever").

πŸ‘‘ DESCRIPTION πŸ‘‘

So here's the tea πŸ“: this returns -ERESTARTSYS if it gets interrupted, 0 if the wait timed out, or the remaining timeout in jiffies on success. Other error values may also be returned on custom implementations β€” so like, don't assume it's only those three, mmkay? πŸ’€

It performs a synchronous wait on this fence. Like, it's not doing anything cute in the background, it is literally waiting. periodt.

⚠️ ok this part is important, no skipping πŸ™ˆ: it is assumed the caller directly or indirectly (buf-mgr between reservation and committing) holds a reference to the fence. Otherwise the fence might be freed before return, resulting in undefined behavior. that's the "do not do this, I'm so serious" warning 🫢 please hold your reference, bestie, the fence deserves to stay alive until you're done.

Also see also dma_fence_wait and dma_fence_wait_any_timeout πŸ’œ β€” the little family of wait functions, they're all icons in their own right.

⭐ SEE ALSO ⭐

that's a whole friend group right there, obsessed πŸ’…βœ¨


πŸ’« and that's the page!! πŸ’« source: ./drivers/dma-buf, dated October 2026 β€” mwah, sending you all the love and the correct fence references πŸŽ€πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from