aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2012-06-24 14:23:53 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-07-10 05:18:51 -0400
commit62761d1f68937b4d3dd509032942290f2359bde7 (patch)
treef425cb4ea938b7ae2eb0052424737aa1eba5701e
parent9c41ef086e435be8f10be4cb9636c7ecf6709ddd (diff)
powerpc/vio: Remove dma not supported warnings
During boot we see a number of these warnings: vio 30000000: Warning: IOMMU dma not supported: mask 0xffffffffffffffff, table unavailable The reason for this is that we set IOMMU properties for all VIO devices even if they are not DMA capable. Only set DMA ops, table and mask for devices with a DMA window. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--arch/powerpc/kernel/vio.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index 06cbc309b817..7d05fe2b5637 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1397,21 +1397,27 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
1397 viodev->name = of_node->name; 1397 viodev->name = of_node->name;
1398 viodev->dev.of_node = of_node_get(of_node); 1398 viodev->dev.of_node = of_node_get(of_node);
1399 1399
1400 if (firmware_has_feature(FW_FEATURE_CMO))
1401 vio_cmo_set_dma_ops(viodev);
1402 else
1403 set_dma_ops(&viodev->dev, &dma_iommu_ops);
1404 set_iommu_table_base(&viodev->dev, vio_build_iommu_table(viodev));
1405 set_dev_node(&viodev->dev, of_node_to_nid(of_node)); 1400 set_dev_node(&viodev->dev, of_node_to_nid(of_node));
1406 1401
1407 /* init generic 'struct device' fields: */ 1402 /* init generic 'struct device' fields: */
1408 viodev->dev.parent = &vio_bus_device.dev; 1403 viodev->dev.parent = &vio_bus_device.dev;
1409 viodev->dev.bus = &vio_bus_type; 1404 viodev->dev.bus = &vio_bus_type;
1410 viodev->dev.release = vio_dev_release; 1405 viodev->dev.release = vio_dev_release;
1411 /* needed to ensure proper operation of coherent allocations 1406
1412 * later, in case driver doesn't set it explicitly */ 1407 if (of_get_property(viodev->dev.of_node, "ibm,my-dma-window", NULL)) {
1413 dma_set_mask(&viodev->dev, DMA_BIT_MASK(64)); 1408 if (firmware_has_feature(FW_FEATURE_CMO))
1414 dma_set_coherent_mask(&viodev->dev, DMA_BIT_MASK(64)); 1409 vio_cmo_set_dma_ops(viodev);
1410 else
1411 set_dma_ops(&viodev->dev, &dma_iommu_ops);
1412
1413 set_iommu_table_base(&viodev->dev,
1414 vio_build_iommu_table(viodev));
1415
1416 /* needed to ensure proper operation of coherent allocations
1417 * later, in case driver doesn't set it explicitly */
1418 dma_set_mask(&viodev->dev, DMA_BIT_MASK(64));
1419 dma_set_coherent_mask(&viodev->dev, DMA_BIT_MASK(64));
1420 }
1415 1421
1416 /* register with generic device framework */ 1422 /* register with generic device framework */
1417 if (device_register(&viodev->dev)) { 1423 if (device_register(&viodev->dev)) {