[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241029112302.63639-1-joro@8bytes.org>
Date: Tue, 29 Oct 2024 12:23:02 +0100
From: Joerg Roedel <joro@...tes.org>
To: iommu@...ts.linux.dev
Cc: Will Deacon <will@...nel.org>,
linux-kernel@...r.kernel.org,
Joerg Roedel <jroedel@...e.de>,
Jason Gunthorpe <jgg@...pe.ca>
Subject: [PATCH] iommu: Restore iommu_flush_iotlb_all()
From: Joerg Roedel <jroedel@...e.de>
This patch restores the iommu_flush_iotlb_all() function.
Commit
69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")
claims it removed the last call-site, except it did not. There is still
at least one caller in
drivers/gpu/drm/msm/msm_iommu.c
so keep the function around until all call-sites are updated.
Cc: Jason Gunthorpe <jgg@...pe.ca>
Fixes: 69e5a17511f6 ("iommu: Remove useless flush from iommu_create_device_direct_mappings()")
Signed-off-by: Joerg Roedel <jroedel@...e.de>
---
include/linux/iommu.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 522efdc7d815..8cce372a33f1 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -853,6 +853,12 @@ 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)
{
@@ -1137,6 +1143,10 @@ 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)
{
--
2.47.0
Powered by blists - more mailing lists