From: Christoph Hellwig Date: Sat, 5 Oct 2024 09:00:08 +0000 (+0200) Subject: iommu/dma: don't align in iommu_dma_free_iova X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=71f2d603448ed20589f232818c5b805903e7b92e;p=users%2Fhch%2Fblock.git iommu/dma: don't align in iommu_dma_free_iova 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 --- diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index 0483fab229ef..a01a5d9d7ea5 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -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)