dma_release...dev_coherent(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… dma_release_from_dev_coherent(9) β€” from the Kernel API Manual

okay so bestie, we're in the Kernel API Manual today and this one's a little function with main character energy β€” it's literally the "hey, this memory belongs to our pool, lemme hand it back" vibe check for device coherent memory. 🧚


✨ NAME ✨

dma_release_from_dev_coherent β€” free memory back to the device coherent memory pool. that's it, that's the whole job. πŸ’–


🌸 SYNOPSIS 🌸

int dma_release_from_dev_coherent(struct device *dev, int order, void *vaddr);

like, three args, one int coming back at you. no cap. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device whose memory we're talking about, i.e. the one this memory was originally allocated from 🫢
  • order β€” the order of the pages that were allocated. yes, order, like the buddy allocator kind, not like a coffee order 😭
  • vaddr β€” the virtual address of the allocated pages. the actual pointer, the real one πŸ’…

πŸ’… DESCRIPTION πŸ’…

so here's the tea: this function checks whether that memory came out of the per-device coherent memory pool, and if it did β€” slay β€” it releases it. that's the whole loop, bestie. πŸ¦‹

the return value is doing a whole little two-party situation:

  • returns 1 if we correctly released the memory πŸ‘‘ (iconic, we did it)
  • returns 0 if the caller should go ahead and release memory from the generic pools instead πŸ™ˆ (not our memory, not our problem)
literally just: "is this mine? yes β†’ free it, return 1. no β†’ return 0 and let the caller handle it elsewhere." periodt. πŸ’€

🌈 SEE ALSO 🌈


and that's the page!! source is ./kernel/dma, dated October 2026, and the footer's just echoing the same title back at you because the kernel doc build said so πŸ’œ mwah, go free that coherent memory responsibly βœ¨πŸŽ€

πŸ“¦ where this page comes from