dmaengine_terminate_async(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dmaengine_terminate_async β€” the Kernel API Manual, bestie edition ✨

okay so bestie, we're in the <pink>Kernel API Manual</pink> and today's main character is dmaengine_terminate_async. she cancels DMA transfers. that's her whole thing. let's get into it πŸŽ€


🌸 NAME 🌸

dmaengine_terminate_async β€” Terminate all active DMA transfers


✨ SYNOPSIS ✨

int dmaengine_terminate_async (struct dma_chan *chan );

like, that's it. one function, one arg, returns an int. iconic behavior honestly πŸ’…


🫢 ARGUMENTS 🫢

  • chan β€” The channel for which to terminate the transfers. that's the one, the only, the channel you're ghosting πŸ”₯

πŸ‘‘ DESCRIPTION πŸ‘‘

Calling this function will terminate all active and pending descriptors that have previously been submitted to the channel. so like, everything in the queue? gone. not me clearing the whole group chat 😭

But ngl, it's not guaranteed that the transfer for the active descriptor has actually stopped by the time the function returns. like she said "you're done" but the vibe is still loading πŸ’€ And furthermore β€” plot twist β€” it is possible that the complete callback of a submitted transfer is still running when this function returns. yes, really. the callback is still out there living its life 🧚

⚠️ so before you go freeing any memory that is accessed by previously submitted descriptors β€” or before freeing any resources accessed from within the completion callback of any previously submitted descriptors β€” dmaengine_synchronize needs to be called. no cap. that's the safe-to-free check. periodt.

The good news: this function can be called from atomic context as well as from within a complete callback of a descriptor submitted on the same channel. she's flexible like that 🌈 (iykyk, that's a very specific flex)

If none of the two conditions above apply, consider using dmaengine_terminate_sync instead. like, there's a whole other function for your situation, bestie, go get her πŸ¦‹


πŸ’œ SEE ALSO πŸ’œ

that's a lot of cross-references and every single one of them is here because we don't gatekeep on this blog πŸ’–


πŸ“ bye bestie πŸ“

so anyway, this page lives in <purple>./include/linux</purple>, it's dated <cyan>October 2026</cyan>, and it's page <hotpink>dmaengine_terminate_async(9)</hotpink> of the Kernel API Manual. go call dmaengine_synchronize before you free anything, ily, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from