]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommu/dma: implement DMA_ATTR_MMIO for iommu_dma_(un)map_phys()
authorLeon Romanovsky <leonro@nvidia.com>
Tue, 9 Sep 2025 13:27:34 +0000 (16:27 +0300)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 11 Sep 2025 22:18:20 +0000 (00:18 +0200)
commitf9374de14c0e8c36cfb7c68618c07cb155e6f8e6
treedfa567ebebde40dfcb6d9a01bae55e8d44d4c362
parent513559f73700966ded094b090c3ecc6dff877ef9
iommu/dma: implement DMA_ATTR_MMIO for iommu_dma_(un)map_phys()

Make iommu_dma_map_phys() and iommu_dma_unmap_phys() respect
DMA_ATTR_MMIO.

DMA_ATTR_MMIO makes the functions behave the same as
iommu_dma_(un)map_resource():
 - No swiotlb is possible
 - No cache flushing is done (ATTR_MMIO should not be cached memory)
 - prot for iommu_map() has IOMMU_MMIO not IOMMU_CACHE

This is preparation for replacing iommu_dma_map_resource() callers
with iommu_dma_map_phys(DMA_ATTR_MMIO) and removing
iommu_dma_(un)map_resource().

Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Link: https://lore.kernel.org/r/acc255bee358fec9c7da6b2a5904ee50abcd09f1.1757423202.git.leonro@nvidia.com
drivers/iommu/dma-iommu.c