summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/vio.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2010-10-18 07:27:04 +0000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-12-09 15:17:50 +1100
commitb3c73856ae47d43d0d181f9de1c1c6c0820c4515 (patch)
treee7528ed3ed14b57f5861edb528c86adb1c66c393 /arch/powerpc/kernel/vio.c
parent56d8adc5695a8d3f070c8498d532389580af5611 (diff)
downloadlinux-b3c73856ae47d43d0d181f9de1c1c6c0820c4515.tar.gz
linux-b3c73856ae47d43d0d181f9de1c1c6c0820c4515.tar.bz2
linux-b3c73856ae47d43d0d181f9de1c1c6c0820c4515.zip
powerpc/iommu: Use coherent_dma_mask for alloc_coherent
The IOMMU code has been passing the dma-mask instead of the coherent_dma_mask to the iommu allocator. Coherent allocations should be made using the coherent_dma_mask. Also update the vio code to ensure the coherent_dma_mask is set. Without this change drivers, such as ibmvscsi, fail to load with the corrected dma_iommu_alloc_coherent(). Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/vio.c')
-rw-r--r--arch/powerpc/kernel/vio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index b2654058f2e4..1b695fdc362b 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1257,6 +1257,10 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
viodev->dev.parent = &vio_bus_device.dev;
viodev->dev.bus = &vio_bus_type;
viodev->dev.release = vio_dev_release;
+ /* needed to ensure proper operation of coherent allocations
+ * later, in case driver doesn't set it explicitly */
+ dma_set_mask(&viodev->dev, DMA_BIT_MASK(64));
+ dma_set_coherent_mask(&viodev->dev, DMA_BIT_MASK(64));
/* register with generic device framework */
if (device_register(&viodev->dev)) {