]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iommu: generalize the batched sync after map interface
authorChristoph Hellwig <hch@lst.de>
Mon, 5 May 2025 07:01:40 +0000 (10:01 +0300)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 6 May 2025 06:36:53 +0000 (08:36 +0200)
commit5c87cffe2d3853cfae61e9373ee98a0409839178
tree1eb57c151b2e99c6320a5786e9c81d481b3a13da
parentca2c2e4a78c619bcf1c1df29fee5981035f3fcbc
iommu: generalize the batched sync after map interface

For the upcoming IOVA-based DMA API we want to batch the
ops->iotlb_sync_map() call after mapping multiple IOVAs from
dma-iommu without having a scatterlist. Improve the API.

Add a wrapper for the map_sync as iommu_sync_map() so that callers
don't need to poke into the methods directly.

Formalize __iommu_map() into iommu_map_nosync() which requires the
caller to call iommu_sync_map() after all maps are completed.

Refactor the existing sanity checks from all the different layers
into iommu_map_nosync().

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Will Deacon <will@kernel.org>
Tested-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
drivers/iommu/iommu.c
include/linux/iommu.h