iommu/dma: Refactor iommu_dma_alloc, part 2
authorChristoph Hellwig <hch@lst.de>
Mon, 20 May 2019 07:29:42 +0000 (09:29 +0200)
committerJoerg Roedel <jroedel@suse.de>
Mon, 27 May 2019 15:31:11 +0000 (17:31 +0200)
commitee1ef05d02b03118e4c197e1193329f5b64246b7
tree61e34e68b7e7ff52086b99d458a10b55680e3137
parent9ad5d6eddcb0fa7c227c0612011221e715e8ef49
iommu/dma: Refactor iommu_dma_alloc, part 2

All the logic in iommu_dma_alloc that deals with page allocation from
the CMA or page allocators can be split into a self-contained helper,
and we can than map the result of that or the atomic pool allocation
with the iommu later.  This also allows reusing __iommu_dma_free to
tear down the allocations and MMU mappings when the IOMMU mapping
fails.

Based on a patch from Robin Murphy.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/dma-iommu.c