dmaengine_synchronize(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so bestie, welcome to dmaengine_synchronize(9) from the Kernel API Manual β€” this is the little kernel API page about syncing up DMA channel termination, and it is lowkey very important if you’re freeing descriptor memory and don’t want chaos. πŸ’…

✨ SYNOPSIS ✨

void dmaengine_synchronize (struct dma_chan *chan );

πŸŽ€ ARGUMENTS πŸŽ€

  • chan β€” the channel to synchronize. That’s the whole assignment, bestie. 🫢

πŸ’… DESCRIPTION πŸ’…

So this function synchronizes the DMA channel termination to the current context. When it returns, it is guaranteed that all transfers for previously issued descriptors have stopped, and it is safe to free the memory associated with them. ✨

Furthermore β€” and this is the part you need to hear β€” it is guaranteed that all complete callback functions for a previously submitted descriptor have finished running, and it is safe to free resources accessed from within the complete callbacks. no cap, that’s the guarantee. πŸ¦‹

🚨 warning bestie: the behavior of this function is undefined if dma_async_issue_pending has been called between dmaengine_terminate_async and this function. Do not do that. πŸ’€

This function must only be called from non-atomic context, and it must not be called from within a complete callback of a descriptor submitted on the same channel. Like, that’s the rule. periodt. 🌸

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./include/linux/dmaengine.h, plus all these iconic little references:

dma_cookie_t(9), enum dma_status(9), enum dma_transaction_type(9), enum dma_transfer_direction(9), struct data_chunk(9), struct dma_interleaved_template(9), struct dma_vec(9), enum dma_ctrl_flags(9), enum sum_check_bits(9), enum sum_check_flags(9), enum dma_desc_metadata_mode(9), struct dma_chan_percpu(9), struct dma_router(9), struct dma_chan(9), struct dma_chan_dev(9), enum dma_slave_buswidth(9), struct dma_slave_config(9), enum dma_residue_granularity(9), struct dma_slave_caps(9), dma_filter_fn(9), struct dma_async_tx_descriptor(9), struct dma_tx_state(9), enum dmaengine_alignment(9), struct dma_slave_map(9), struct dma_filter(9), struct dma_device(9), dmaengine_prep_peripheral_dma_vec(9), dmaengine_prep_config_sg_safe(9), dmaengine_prep_config_single_safe(9), dmaengine_prep_dma_memset(9), dmaengine_terminate_all(9), dmaengine_terminate_async(9), dmaengine_terminate_sync(9), dma_async_issue_pending(9), dma_async_is_tx_complete(9), dma_async_is_complete(9).


mwah πŸ’‹ this cutie lives under ./include/linux, the page is dated October 2026, and it’s serving dmaengine_synchronize(9) β€” slay, bye. πŸŽ€βœ¨

πŸ“¦ where this page comes from