powerpc/vio: Fix a dma_mask issue of vio

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Nov 22 17:59:02 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=c6102609289de268bcc6093e606483ea8bb35c84
Commit:     c6102609289de268bcc6093e606483ea8bb35c84
Parent:     dc7a9bd3d0583bdc6ac291b4e1bf540dea398ea2
Author:     Li Zhong <zhong at linux.vnet.ibm.com>
AuthorDate: Tue Nov 19 16:11:37 2013 +0800
Committer:  Benjamin Herrenschmidt <benh at kernel.crashing.org>
CommitDate: Thu Nov 21 10:33:43 2013 +1100

    powerpc/vio: Fix a dma_mask issue of vio
    
    I encountered following issue:
    [    0.283035] ibmvscsi 30000015: couldn't initialize event pool
    [    5.688822] ibmvscsi: probe of 30000015 failed with error -1
    
    which prevents the storage from being recognized, and the machine from
    booting.
    
    After some digging, it seems that it is caused by commit 4886c399da
    
    as dma_mask pointer in viodev->dev is not set, so in
    dma_set_mask_and_coherent(), dma_set_coherent_mask() is not called
    because dma_set_mask(), which is dma_set_mask_pSeriesLP() returned EIO.
    While before the commit, dma_set_coherent_mask() is always called.
    
    I tried to replace dma_set_mask_and_coherent() with
    dma_coerce_mask_and_coherent(), and the machine could boot again.
    
    Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
---
 arch/powerpc/kernel/vio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/vio.c b/arch/powerpc/kernel/vio.c
index e7d0c88f..76a6482 100644
--- a/arch/powerpc/kernel/vio.c
+++ b/arch/powerpc/kernel/vio.c
@@ -1419,7 +1419,7 @@ 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_set_mask_and_coherent(&viodev->dev, DMA_BIT_MASK(64));
+		dma_coerce_mask_and_coherent(&viodev->dev, DMA_BIT_MASK(64));
 	}
 
 	/* register with generic device framework */



More information about the linux-mtd-cvs mailing list