Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH] serial: amba-pl011: Fix RX stall when DMA is used
@ 2024-11-13  5:10 Kartik
  2024-11-13  5:31 ` Greg KH
  2024-11-13 17:57 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Kartik @ 2024-11-13  5:10 UTC (permalink / raw)
  To: linux, gregkh, jirislaby, theo.lebrun, linus.walleij,
	ilpo.jarvinen, l.sanfilippo, konradybcio, christophe.jaillet,
	arnd, linux-kernel, linux-serial

Function pl011_throttle_rx() calls pl011_stop_rx() to disable RX, which
also disables the RX DMA by clearing the RXDMAE bit of the DMACR
register. However, to properly unthrottle RX when DMA is used, the
function pl011_unthrottle_rx() is expected to set the RXDMAE bit of
the DMACR register, which it currently lacks. This causes RX to stall
after the throttle API is called.

Set RXDMAE bit in the DMACR register while unthrottling RX if RX DMA is
used.

Fixes: 211565b10099 ("serial: pl011: UPSTAT_AUTORTS requires .throttle/unthrottle")
Signed-off-by: Kartik <kkartik@nvidia.com>
---
 drivers/tty/serial/amba-pl011.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 4c4b0d470c65..f40714685166 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -1819,6 +1819,11 @@ static void pl011_unthrottle_rx(struct uart_port *port)
 
 	pl011_write(uap->im, uap, REG_IMSC);
 
+	if (uap->using_rx_dma) {
+		uap->dmacr |= UART011_RXDMAE;
+		pl011_write(uap->dmacr, uap, REG_DMACR);
+	}
+
 	uart_port_unlock_irqrestore(&uap->port, flags);
 }
 
-- 
2.47.0


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

end of thread, other threads:[~2024-11-13 17:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-13  5:10 [PATCH] serial: amba-pl011: Fix RX stall when DMA is used Kartik
2024-11-13  5:31 ` Greg KH
2024-11-13 17:57 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox