]> www.infradead.org Git - users/hch/block.git/commitdiff
iommu/dma: don't align in iommu_dma_free_iova
authorChristoph Hellwig <hch@lst.de>
Sat, 5 Oct 2024 09:00:08 +0000 (11:00 +0200)
committerChristoph Hellwig <hch@lst.de>
Sat, 5 Oct 2024 16:14:16 +0000 (18:14 +0200)
state->addr and state->size cover the entire iova range, there is no
need to align them.

Also don't bother with the gather structure when it's not used for
anything.

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

index 0483fab229ef0a4890cb91b9bdcde69462a4295c..a01a5d9d7ea57bb83840a99ca85156e6079b59d9 100644 (file)
@@ -1768,14 +1768,8 @@ void iommu_dma_free_iova(struct dma_iova_state *state)
 {
        struct iommu_domain *domain = iommu_get_dma_domain(state->dev);
        struct iommu_dma_cookie *cookie = domain->iova_cookie;
-       struct iova_domain *iovad = &cookie->iovad;
-       size_t iova_off = iova_offset(iovad, state->addr);
-       struct iommu_iotlb_gather iotlb_gather;
 
-       iommu_iotlb_gather_init(&iotlb_gather);
-       __iommu_dma_free_iova(cookie, state->addr - iova_off,
-                             iova_align(iovad, state->size + iova_off),
-                             &iotlb_gather);
+       __iommu_dma_free_iova(cookie, state->addr, state->size, NULL);
 }
 
 int iommu_dma_start_range(struct device *dev)