Skip to content

Commit c2273a1

Browse files
wildea01Russell King
authored andcommitted
ARM: 8288/1: dma-mapping: don't detach devices without an IOMMU during teardown
When tearing down the DMA ops for a device via of_dma_deconfigure, we unconditionally detach the device from its IOMMU domain. For devices that aren't actually behind an IOMMU, this produces a "Not attached" warning message on the console. This patch changes the teardown code so that we don't detach from the IOMMU domain when there isn't an IOMMU dma mapping to start with. Reported-by: Laurent Pinchart <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 909ba29 commit c2273a1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/arm/mm/dma-mapping.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2025,6 +2025,9 @@ static void arm_teardown_iommu_dma_ops(struct device *dev)
20252025
{
20262026
struct dma_iommu_mapping *mapping = dev->archdata.mapping;
20272027

2028+
if (!mapping)
2029+
return;
2030+
20282031
arm_iommu_detach_device(dev);
20292032
arm_iommu_release_mapping(mapping);
20302033
}

0 commit comments

Comments
 (0)