Skip to contentSkip to conversation

tty/serial/pl011: don't print error msg if dmaengine_pause is not supported

PATCH New Viresh Kumar 3 participants 4 messages Apr 18, 2011 – Apr 19, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty/serial/pl011: don't print error msg if dmaengine_pause is not supported

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.

---
 drivers/tty/serial/amba-pl011.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
drivers/tty/serial/amba-pl011.c +8 -5
index 6deee4e..c0e1a42 100644
@@ -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;
Signature · 1 line
1.7.2.2
#1 lore raw

PATCH 1/1 tty/serial/pl011: don't print error msg if dmaengine_pause is not supported

Quoted 3 lines · Viresh Kumar

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.

#2 lore raw

PATCH 1/1 tty/serial/pl011: don't print error msg if dmaengine_pause is not supported

Quoted 5 lines · Russell King - ARM Linux
Quoted 3 lines · Viresh Kumar

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.

Quoted 8 lines

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.

#3 lore raw

PATCH 1/1 tty/serial/pl011: don't print error msg if dmaengine_pause is not supported

In reply to Viresh Kumar

2011/4/18 Viresh Kumar <[email protected]>:

Quoted 3 lines

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