[PATCH v2 2/3] ARM: dma-mapping: don't detach devices without an IOMMU during teardown

Will Deacon will.deacon at arm.com
Wed Jan 14 11:13:22 PST 2015

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 <laurent.pinchart at ideasonboard.com>
Signed-off-by: Will Deacon <will.deacon at arm.com>
 arch/arm/mm/dma-mapping.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index 7864797609b3..f142ddd6c40a 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -2025,6 +2025,9 @@ static void arm_teardown_iommu_dma_ops(struct device *dev)
 	struct dma_iommu_mapping *mapping = dev->archdata.mapping;
+	if (!mapping)
+		return;

More information about the linux-arm-kernel mailing list