linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty/serial/pl011: don't print error msg if dmaengine_pause is not supported
@ 2011-04-18 11:22 Viresh Kumar
  2011-04-18 15:13 ` Russell King - ARM Linux
  2011-04-19  0:27 ` Linus Walleij
  0 siblings, 2 replies; 4+ messages in thread
From: Viresh Kumar @ 2011-04-18 11:22 UTC (permalink / raw)
  To: linux-arm-kernel

Few dma controller doesn't support dmaengine_pause() and return -ENXIO if
dmaengine_pause() is called for them. Error messages such as "unable to pause
DMA transfer" shouldn't be printed for them.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
---
 drivers/tty/serial/amba-pl011.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 6deee4e..c0e1a42 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -755,18 +755,21 @@ static void pl011_dma_rx_irq(struct uart_amba_port *uap)
 	size_t pending;
 	struct dma_tx_state state;
 	enum dma_status dmastat;
+	int ret;
 
 	/*
 	 * Pause the transfer so we can trust the current counter,
 	 * do this before we pause the PL011 block, else we may
 	 * overflow the FIFO.
 	 */
-	if (dmaengine_pause(rxchan))
-		dev_err(uap->port.dev, "unable to pause DMA transfer\n");
+	ret = dmaengine_pause(rxchan);
+	if (ret && ret != -ENXIO)
+		dev_err(uap->port.dev, "unable to pause DMA transfer");
+
 	dmastat = rxchan->device->device_tx_status(rxchan,
-						   dmarx->cookie, &state);
-	if (dmastat != DMA_PAUSED)
-		dev_err(uap->port.dev, "unable to pause DMA transfer\n");
+			dmarx->cookie, &state);
+	if (ret != -ENXIO && dmastat != DMA_PAUSED)
+		dev_err(uap->port.dev, "unable to pause DMA transfer");
 
 	/* Disable RX DMA - incoming data will wait in the FIFO */
 	uap->dmacr &= ~UART011_RXDMAE;
-- 
1.7.2.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] tty/serial/pl011: don't print error msg if dmaengine_pause is not supported
  2011-04-18 11:22 [PATCH] tty/serial/pl011: don't print error msg if dmaengine_pause is not supported Viresh Kumar
@ 2011-04-18 15:13 ` Russell King - ARM Linux
  2011-04-19  6:07   ` viresh kumar
  2011-04-19  0:27 ` Linus Walleij
  1 sibling, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2011-04-18 15:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 18, 2011 at 04:52:00PM +0530, Viresh Kumar wrote:
> Few dma controller doesn't support dmaengine_pause() and return -ENXIO if
> dmaengine_pause() is called for them. Error messages such as "unable to pause
> DMA transfer" shouldn't be printed for them.

It is _required_ to pause the DMA engine at this point, as we need to
read characters via PIO.  Leaving the DMA engine active at this point
invites it to transfer additional characters beneath us, before we've
had time to properly update the DMA engine for the characters received.

So, dmaengine_pause() is a requirement for PL011.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] tty/serial/pl011: don't print error msg if dmaengine_pause is not supported
  2011-04-18 11:22 [PATCH] tty/serial/pl011: don't print error msg if dmaengine_pause is not supported Viresh Kumar
  2011-04-18 15:13 ` Russell King - ARM Linux
@ 2011-04-19  0:27 ` Linus Walleij
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Walleij @ 2011-04-19  0:27 UTC (permalink / raw)
  To: linux-arm-kernel

2011/4/18 Viresh Kumar <viresh.kumar@st.com>:

> Few dma controller doesn't support dmaengine_pause() and return -ENXIO if
> dmaengine_pause() is called for them. Error messages such as "unable to pause
> DMA transfer" shouldn't be printed for them.

Hm for dw_dma this seems like a piece of cake to simply implement
instead.

I'll send a patch for that instead, can you test it and ACK it if it
works for you?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] tty/serial/pl011: don't print error msg if dmaengine_pause is not supported
  2011-04-18 15:13 ` Russell King - ARM Linux
@ 2011-04-19  6:07   ` viresh kumar
  0 siblings, 0 replies; 4+ messages in thread
From: viresh kumar @ 2011-04-19  6:07 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/18/2011 08:43 PM, Russell King - ARM Linux wrote:
> On Mon, Apr 18, 2011 at 04:52:00PM +0530, Viresh Kumar wrote:
>> Few dma controller doesn't support dmaengine_pause() and return -ENXIO if
>> dmaengine_pause() is called for them. Error messages such as "unable to pause
>> DMA transfer" shouldn't be printed for them.
> 
> It is _required_ to pause the DMA engine at this point, as we need to
> read characters via PIO.  Leaving the DMA engine active at this point
> invites it to transfer additional characters beneath us, before we've
> had time to properly update the DMA engine for the characters received.
> 
> So, dmaengine_pause() is a requirement for PL011.
> .
> 

Ok.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-19  6:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-18 11:22 [PATCH] tty/serial/pl011: don't print error msg if dmaengine_pause is not supported Viresh Kumar
2011-04-18 15:13 ` Russell King - ARM Linux
2011-04-19  6:07   ` viresh kumar
2011-04-19  0:27 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).