dma_fence_set_error(9)
π 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β thedma_fencein 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:
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_timestamp(9)dma_fence_wait(9)dma_fence_is_array(9)dma_fence_is_chain(9)dma_fence_is_container(9)
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
- 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