iommu/dma: Refactor iommu_dma_free
authorRobin Murphy <robin.murphy@arm.com>
Mon, 20 May 2019 07:29:36 +0000 (09:29 +0200)
committerJoerg Roedel <jroedel@suse.de>
Mon, 27 May 2019 15:31:11 +0000 (17:31 +0200)
commitbcf4b9c4c2ee0f00d9e273b19419416a20cce9a4
tree0f3d394f74b0682dde1b2900069b985cdfa8528d
parentaa8ba2275705aa47df9f52e13c5126688c478966
iommu/dma: Refactor iommu_dma_free

The freeing logic was made particularly horrible by part of it being
opaque to the arch wrapper, which led to a lot of convoluted repetition
to ensure each path did everything in the right order. Now that it's
all private, we can pick apart and consolidate the logically-distinct
steps of freeing the IOMMU mapping, the underlying pages, and the CPU
remap (if necessary) into something much more manageable.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
[various cosmetic changes to the code flow]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/dma-iommu.c