powerpc: Revert c6102609 and replace it with the correct fix for vio dma mask setting
authorLi Zhong <zhong@linux.vnet.ibm.com>
Thu, 28 Nov 2013 09:22:25 +0000 (17:22 +0800)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 7 Mar 2014 04:50:12 +0000 (15:50 +1100)
This patch reverts my previous "fix", and replace it with the correct
fix from Russell.

And as Russell pointed out -- dma_set_mask_and_coherent() (and the other
dma_set_mask() functions) are really supposed to be used by drivers
only.

Signed-off-by: Li Zhong <zhong@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/kernel/vio.c

index 826d8bd9e5223d94eccfe3639d980e323c78b189..904c66128faeb7d31a8463532929d187254da7ed 100644 (file)
@@ -1432,7 +1432,8 @@ struct vio_dev *vio_register_device_node(struct device_node *of_node)
 
                /* needed to ensure proper operation of coherent allocations
                 * later, in case driver doesn't set it explicitly */
-               dma_coerce_mask_and_coherent(&viodev->dev, DMA_BIT_MASK(64));
+               viodev->dev.coherent_dma_mask = DMA_BIT_MASK(64);
+               viodev->dev.dma_mask = &viodev->dev.coherent_dma_mask;
        }
 
        /* register with generic device framework */