dma_fence_set_error(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dma_fence_set_error(9) β€” Kernel API Manual ✨

okay bestie, welcome to the dma_fence_set_error page from the Kernel API Manual, and honestly? it's a little baddie of a function. let's get into it πŸŽ€


🌸 NAME 🌸

dma_fence_set_error β€” flag an error condition on the fence 🚩


✨ SYNOPSIS ✨

void dma_fence_set_error (struct dma_fence *fence , int error );

🫢 ARGUMENTS 🫢

  • fence β€” the dma_fence in question, the main character of this whole situation πŸ‘‘
  • error β€” the error you wanna store. your little truth bomb πŸ’€

πŸ’– DESCRIPTION πŸ’–

so here's the tea β˜• β€” drivers can supply an optional error status condition before they signal the fence. what's that for? it's to say "hey, this fence got completed because of an error, not because everything slayed" 😭 so basically success is not the vibe, error is the vibe.

hard rule bestie: this must be set before signaling β€” that way the value is visible before any waiters on the signal callback get woken up. no sneaking it in after, fr fr. πŸ™ˆ

this helper literally exists to help catch erroneous setting of #dma_fence.error. it's giving safety net, it's giving guard rails, it's giving "we've all been there" πŸ’…


πŸ¦‹ Examples of error codes which drivers should use πŸ¦‹

  • -ENODATA β€” this operation produced no data, and no other operation was affected. like, nothing happened, nothing was touched, we move πŸ“
  • -ECANCELED β€” all operations from the same context have been canceled. the whole group chat got deleted 😭
  • -ETIME β€” the operation caused a timeout and potentially a device reset. highkey dramatic, lowkey serious πŸ”₯

🌈 SEE ALSO 🌈

Kernel file ./include/linux/dma-fence.h and the whole friend group:


sign-off time πŸŽ€ this iconic little page lives in ./include/linux, and it's stamped October 2026 in the Kernel API Manual. that's the vibe check, and it passed. periodt. πŸ’œπŸ§šβ€β™€οΈβ­
πŸ“¦ where this page comes from