dma_iova_free(9)
π 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, bestiestateβ 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_destroyand move on π§
π« SEE ALSO π«
Kernel file ./drivers/iommu/dma-iommu.c β that's where the magic lives, iykyk πβ¨
and the whole friend group:
iommu_get_dma_cookie(9)iommu_get_msi_cookie(9)iommu_put_dma_cookie(9)iommu_put_msi_cookie(9)iommu_dma_get_resv_regions(9)iommu_dma_init_options(9)iommu_dma_init_domain(9)dma_info_to_prot(9)dma_iova_try_alloc(9)dma_iova_link(9)dma_iova_sync(9)dma_iova_unlink(9)dma_iova_destroy(9)
lowkey the funniest part is the description saysdma_try_iova_allocand SEE ALSO saysdma_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
- 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