]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: omap3isp: Handle ARM dma_iommu_mapping
authorRobin Murphy <robin.murphy@arm.com>
Mon, 28 Oct 2024 17:58:36 +0000 (17:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:38 +0000 (14:39 +0200)
commit 6bc076eec6f85f778f33a8242b438e1bd9fcdd59 upstream.

It's no longer practical for the OMAP IOMMU driver to trick
arm_setup_iommu_dma_ops() into ignoring its presence, so let's use the
same tactic as other IOMMU API users on 32-bit ARM and explicitly kick
the arch code's dma_iommu_mapping out of the way to avoid problems.

Fixes: 4720287c7bf7 ("iommu: Remove struct iommu_ops *iommu from arch_setup_dma_ops()")
Cc: stable@vger.kernel.org
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Tested-by: Sicelo A. Mhlongo <absicsz@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/ti/omap3isp/isp.c

index 91101ba88ef01f44ea0a9e764204f9630160938a..b2210841a320f47a97706066bd79dd04283beae9 100644 (file)
@@ -1961,6 +1961,13 @@ static int isp_attach_iommu(struct isp_device *isp)
        struct dma_iommu_mapping *mapping;
        int ret;
 
+       /* We always want to replace any default mapping from the arch code */
+       mapping = to_dma_iommu_mapping(isp->dev);
+       if (mapping) {
+               arm_iommu_detach_device(isp->dev);
+               arm_iommu_release_mapping(mapping);
+       }
+
        /*
         * Create the ARM mapping, used by the ARM DMA mapping core to allocate
         * VAs. This will allocate a corresponding IOMMU domain.