summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorWill Deacon <will.deacon@arm.com>2015-01-16 18:01:43 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-01-29 15:22:44 +0000
commitc2273a185354fe9420fb342b1ca09a6fed857fb3 (patch)
tree06e8f8799ff8123485ba7f98e71acb027476959f /arch/arm
parent909ba297beb50981a9d12364688d3c5f3084c6eb (diff)
downloadlinux-c2273a185354fe9420fb342b1ca09a6fed857fb3.tar.bz2
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 <laurent.pinchart@ideasonboard.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mm/dma-mapping.c3
1 files changed, 3 insertions, 0 deletions
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;
+
arm_iommu_detach_device(dev);
arm_iommu_release_mapping(mapping);
}