dma_iova_free(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– dma_iova_free(9) β€” like, the kernel API manual, but make it make sense πŸŽ€

okay bestie, welcome to dma_iova_free from the 9 section of the Kernel API Manual β€” yes we're in kernel-land, yes it's giving big-brain energy, and yes I'm gonna walk you through it like we're texting at 2am πŸ’…


✨ NAME ✨

dma_iova_free β€” Free an IOVA space πŸ¦‹

like literally, it's the "ok we're done here, release the space" function, no cap


🌸 SYNOPSIS 🌸

void dma_iova_free (struct device *dev , struct dma_iova_state *state );

that's it. that's the whole signature. returns void, so nothing to catch, nothing to check β€” she just does her thing and leaves ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device you're freeing the IOVA space for 🫢 like, which device's space are we cleaning up, bestie
  • state β€” the IOVA state πŸ’œ the actual state struct that's holding the IOVA info

πŸ”₯ DESCRIPTION πŸ”₯

So here's the tea β˜• this function undoes a successful dma_try_iova_alloc. That's the whole vibe. You allocated, now you're freeing. Balance restored, universe aligned, slay 🌈

⚠️ but like, read this part twice, bestie: all dma_iova_link calls need to be undone first. Every single one. No skipping. The function will not do it for you and I'm not gonna pretend it will πŸ’€

And for the girlies who never call dma_iova_unlink β€” good news πŸŽ‰ there's dma_iova_destroy instead, which unlinks all ranges and frees the IOVA space in a single efficient operation. one call, everything handled, main character energy πŸ‘‘

so like:

  • linked stuff? β†’ undo it first, then dma_iova_free
  • never linked anything / never unlink? β†’ just use dma_iova_destroy and move on 🧚

πŸ’« SEE ALSO πŸ’«

Kernel file ./drivers/iommu/dma-iommu.c β€” that's where the magic lives, iykyk πŸ“βœ¨

and the whole friend group:


lowkey the funniest part is the description says dma_try_iova_alloc and SEE ALSO says dma_iova_try_alloc(9) β€” I'm not touching it, I'm just reporting what the page says πŸ™ˆ keep both, they're both here, we don't edit manpages in this house

and that's the page, bestie πŸ“ straight from ./drivers/iommu, dated October 2026, filed under dma_iova_free(9) β€” go forth responsibly, unlink before you free, and stan efficient cleanup πŸ’–βœ¨

πŸ“¦ where this page comes from