powerpc: Add coherent_dma_mask setting to platform devices

Submitted by Corey Minyard on Feb. 1, 2010, 7:36 p.m.

Details

Message ID 20100201193647.GA10863@minyard.local
State Superseded
Headers show

Commit Message

Corey Minyard Feb. 1, 2010, 7:36 p.m.
From: Corey Minyard <cminyard@mvista.com>

DMA ops requires that coherent_dma_mask be set properly for a device,
but this was not being done for platform devices on powerpc.  The
MPSC drivers, in particular, need this for both serial and ethernet
or they won't be able to allocate memory.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
How about this patch?  It seems to work ok and I suppose this makes
sense.  I'll send the uart setting in another patch.

Patch hide | download patch | download mbox

Index: linux-2.6/arch/powerpc/kernel/setup-common.c
===================================================================
--- linux-2.6.orig/arch/powerpc/kernel/setup-common.c
+++ linux-2.6/arch/powerpc/kernel/setup-common.c
@@ -681,6 +681,7 @@  static int ppc_dflt_bus_notify(struct no
 		return 0;
 
 	set_dma_ops(dev, &dma_direct_ops);
+	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 
 	return NOTIFY_DONE;
 }