summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/tegra-gart.c
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2023-01-10 10:54:06 +0800
committerJoerg Roedel <jroedel@suse.de>2023-01-13 16:39:16 +0100
commitc1fe9119ee707459421d8f7387e803b0ea78c21b (patch)
tree66cc77a650c53be6a209d162ccabb5b3f0d8735a /drivers/iommu/tegra-gart.c
parent6caeb33fa986151f745fc62190bc28a593b8a0d2 (diff)
downloadlinux-stable-c1fe9119ee707459421d8f7387e803b0ea78c21b.tar.gz
linux-stable-c1fe9119ee707459421d8f7387e803b0ea78c21b.tar.bz2
linux-stable-c1fe9119ee707459421d8f7387e803b0ea78c21b.zip
iommu: Add set_platform_dma_ops callbacks
For those IOMMU drivers that don't provide default domain support, add an implementation of set_platform_dma_ops callback so that the IOMMU core could return the DMA control to platform DMA ops. At the same time, with the set_platform_dma_ops implemented, there is no need for detach_dev. Remove it to avoid dead code. Reviewed-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/20230110025408.667767-4-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/tegra-gart.c')
-rw-r--r--drivers/iommu/tegra-gart.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c
index ed53279d1106..a482ff838b53 100644
--- a/drivers/iommu/tegra-gart.c
+++ b/drivers/iommu/tegra-gart.c
@@ -124,9 +124,9 @@ static int gart_iommu_attach_dev(struct iommu_domain *domain,
return ret;
}
-static void gart_iommu_detach_dev(struct iommu_domain *domain,
- struct device *dev)
+static void gart_iommu_set_platform_dma(struct device *dev)
{
+ struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
struct gart_device *gart = gart_handle;
spin_lock(&gart->dom_lock);
@@ -270,11 +270,11 @@ static const struct iommu_ops gart_iommu_ops = {
.domain_alloc = gart_iommu_domain_alloc,
.probe_device = gart_iommu_probe_device,
.device_group = generic_device_group,
+ .set_platform_dma_ops = gart_iommu_set_platform_dma,
.pgsize_bitmap = GART_IOMMU_PGSIZES,
.of_xlate = gart_iommu_of_xlate,
.default_domain_ops = &(const struct iommu_domain_ops) {
.attach_dev = gart_iommu_attach_dev,
- .detach_dev = gart_iommu_detach_dev,
.map = gart_iommu_map,
.unmap = gart_iommu_unmap,
.iova_to_phys = gart_iommu_iova_to_phys,