Skip to content

Commit 1dc7c8e

Browse files
rmurphy-armmathieupoirier
authored andcommitted
remoteproc: omap: Handle ARM dma_iommu_mapping
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: 4720287 ("iommu: Remove struct iommu_ops *iommu from arch_setup_dma_ops()") Signed-off-by: Robin Murphy <[email protected]> Tested-by: Beleswar Padhi <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/6186e311cb6f64a787f87fd41e49a73f409b789c.1730136799.git.robin.murphy@arm.com [Fixed changelog title] Signed-off-by: Mathieu Poirier <[email protected]>
1 parent 7378aeb commit 1dc7c8e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/remoteproc/omap_remoteproc.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737

3838
#include <linux/platform_data/dmtimer-omap.h>
3939

40+
#ifdef CONFIG_ARM_DMA_USE_IOMMU
41+
#include <asm/dma-iommu.h>
42+
#endif
43+
4044
#include "omap_remoteproc.h"
4145
#include "remoteproc_internal.h"
4246

@@ -1323,6 +1327,19 @@ static int omap_rproc_probe(struct platform_device *pdev)
13231327
/* All existing OMAP IPU and DSP processors have an MMU */
13241328
rproc->has_iommu = true;
13251329

1330+
#ifdef CONFIG_ARM_DMA_USE_IOMMU
1331+
/*
1332+
* Throw away the ARM DMA mapping that we'll never use, so it doesn't
1333+
* interfere with the core rproc->domain and we get the right DMA ops.
1334+
*/
1335+
if (pdev->dev.archdata.mapping) {
1336+
struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(&pdev->dev);
1337+
1338+
arm_iommu_detach_device(&pdev->dev);
1339+
arm_iommu_release_mapping(mapping);
1340+
}
1341+
#endif
1342+
13261343
ret = omap_rproc_of_get_internal_memories(pdev, rproc);
13271344
if (ret)
13281345
return ret;

0 commit comments

Comments
 (0)