]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iommu: Remove useless flush from iommu_create_device_direct_mappings()
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 18 Oct 2024 17:01:19 +0000 (14:01 -0300)
committerJoerg Roedel <jroedel@suse.de>
Tue, 29 Oct 2024 08:52:11 +0000 (09:52 +0100)
These days iommu_map() does not require external flushing, it always
internally handles any required flushes. Since
iommu_create_device_direct_mappings() only calls iommu_map(), remove
the extra call.

Since this is the last call site for iommu_flush_iotlb_all() remove it
too.

Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>
Link: https://lore.kernel.org/r/0-v1-bb6c694e1b07+a29e1-iommu_no_flush_all_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c
include/linux/iommu.h

index 4c29a4bc368baa8f012d8bacdb3a47dad7b29535..e5d5b4fd322ab8cb75f4e03c116fbb439ed133f2 100644 (file)
@@ -1141,10 +1141,6 @@ map_end:
                }
 
        }
-
-       if (!list_empty(&mappings) && iommu_is_dma_domain(domain))
-               iommu_flush_iotlb_all(domain);
-
 out:
        iommu_put_resv_regions(dev, &mappings);
 
index 62d1b85c80d3e1bb63120d393358483ad5fdb887..03f9fa833db995a430b0cd0a86c606b9f8e458ae 100644 (file)
@@ -852,12 +852,6 @@ void iommu_set_dma_strict(void);
 extern int report_iommu_fault(struct iommu_domain *domain, struct device *dev,
                              unsigned long iova, int flags);
 
-static inline void iommu_flush_iotlb_all(struct iommu_domain *domain)
-{
-       if (domain->ops->flush_iotlb_all)
-               domain->ops->flush_iotlb_all(domain);
-}
-
 static inline void iommu_iotlb_sync(struct iommu_domain *domain,
                                  struct iommu_iotlb_gather *iotlb_gather)
 {
@@ -1141,10 +1135,6 @@ static inline ssize_t iommu_map_sg(struct iommu_domain *domain,
        return -ENODEV;
 }
 
-static inline void iommu_flush_iotlb_all(struct iommu_domain *domain)
-{
-}
-
 static inline void iommu_iotlb_sync(struct iommu_domain *domain,
                                  struct iommu_iotlb_gather *iotlb_gather)
 {