arm: dma-mapping: Set DMA IOMMU ops in arm_iommu_attach_device()
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Fri, 23 Jan 2015 14:21:49 +0000 (16:21 +0200)
committerOlof Johansson <olof@lixom.net>
Thu, 29 Jan 2015 18:56:27 +0000 (10:56 -0800)
commiteab8d6530cc00744087bb5566e350cf37fcdfc7e
treef36e2bcb7d7627f265fa631993c9183f2059f5e4
parent764e2c70eff2251e818537ac59f2365d0e4cf524
arm: dma-mapping: Set DMA IOMMU ops in arm_iommu_attach_device()

Commit 4bb25789ed28228a ("arm: dma-mapping: plumb our iommu mapping ops
into arch_setup_dma_ops") moved the setting of the DMA operations from
arm_iommu_attach_device() to arch_setup_dma_ops() where the DMA
operations to be used are selected based on whether the device is
connected to an IOMMU. However, the IOMMU detection scheme requires the
IOMMU driver to be ported to the new IOMMU of_xlate API. As no driver
has been ported yet, this effectively breaks all IOMMU ARM users that
depend on the IOMMU being handled transparently by the DMA mapping API.

Fix this by restoring the setting of DMA IOMMU ops in
arm_iommu_attach_device() and splitting the rest of the function into a
new internal __arm_iommu_attach_device() function, called by
arch_setup_dma_ops().

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm/mm/dma-mapping.c