All of lore.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] powerpc: Add DMA mask to MPSC serial and network and UART device to serial
Date: Fri, 29 Jan 2010 18:04:07 -0600	[thread overview]
Message-ID: <20100130000407.GA16156@minyard.local> (raw)

From: Corey Minyard <cminyard@mvista.com>

The MPSC drivers that use DMA need to set coherent_dma_mask to allow
dma_alloc_xxx routines to work properly.  Also, the mpsc serial driver
needed to set pi->port.dev to register properly.  With these fixes,
the MPSC drivers seem to work again.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
I'm not really sure about where to set the coherent_dma_mask, it seems
like a more general place would be better but I couldn't find it.

Without these, the console stops working after the switchover and
the network driver fails to allocate buffers.  With these, my board
boots up and works fine.

Index: linux-2.6.31/drivers/serial/mpsc.c
===================================================================
--- linux-2.6.31.orig/drivers/serial/mpsc.c
+++ linux-2.6.31/drivers/serial/mpsc.c
@@ -2071,6 +2071,9 @@ static int mpsc_drv_probe(struct platfor
 		if (!(rc = mpsc_drv_map_regs(pi, dev))) {
 			mpsc_drv_get_platform_data(pi, dev, dev->id);
 
+			dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
+			pi->port.dev = &dev->dev;
+
 			if (!(rc = mpsc_make_ready(pi))) {
 				spin_lock_init(&pi->tx_lock);
 				if (!(rc = uart_add_one_port(&mpsc_reg,
Index: linux-2.6.31/drivers/net/mv643xx_eth.c
===================================================================
--- linux-2.6.31.orig/drivers/net/mv643xx_eth.c
+++ linux-2.6.31/drivers/net/mv643xx_eth.c
@@ -2916,7 +2916,7 @@ static int mv643xx_eth_probe(struct plat
 	mp->shared = platform_get_drvdata(pd->shared);
 	mp->base = mp->shared->base + 0x0400 + (pd->port_number << 10);
 	mp->port_num = pd->port_number;
-
+	pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 	mp->dev = dev;
 
 	set_params(mp, pd);

             reply	other threads:[~2010-01-30  1:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-30  0:04 Corey Minyard [this message]
2010-02-01  4:58 ` [PATCH] powerpc: Add DMA mask to MPSC serial and network and UART device to serial Benjamin Herrenschmidt
2010-02-01 18:00   ` Corey Minyard
2010-02-02  7:38     ` Benjamin Herrenschmidt
2010-02-01 19:36   ` [PATCH] powerpc: Add coherent_dma_mask setting to platform devices Corey Minyard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100130000407.GA16156@minyard.local \
    --to=minyard@acm.org \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.