Linux Serial subsystem development
 help / color / mirror / Atom feed
* [PATCH] serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt
@ 2023-10-30 18:39 Ronald Wahl
  2023-10-31  6:06 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Ronald Wahl @ 2023-10-30 18:39 UTC (permalink / raw)
  To: linux-kernel, linux-serial
  Cc: Greg Kroah-Hartman, Vignesh Raghavendra, Ilpo Järvinen,
	Ronald Wahl

Starting RX DMA on THRI interrupt is too early because TX may not have
finished yet.

This change is inspired by commit 90b8596ac460 ("serial: 8250: Prevent
starting up DMA Rx on THRI interrupt") and fixes DMA issues I had with
an AM62 SoC that is using the 8250 OMAP variant.

Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
---
 drivers/tty/serial/8250/8250_omap.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_omap.c b/drivers/tty/serial/8250/8250_omap.c
index c7ab2963040b..f2f59ec6b50b 100644
--- a/drivers/tty/serial/8250/8250_omap.c
+++ b/drivers/tty/serial/8250/8250_omap.c
@@ -1282,10 +1282,11 @@ static int omap_8250_dma_handle_irq(struct uart_port *port)

 	status = serial_port_in(port, UART_LSR);

-	if (priv->habit & UART_HAS_EFR2)
-		am654_8250_handle_rx_dma(up, iir, status);
-	else
-		status = omap_8250_handle_rx_dma(up, iir, status);
+	if ((iir & 0x3f) != UART_IIR_THRI)
+		if (priv->habit & UART_HAS_EFR2)
+			am654_8250_handle_rx_dma(up, iir, status);
+		else
+			status = omap_8250_handle_rx_dma(up, iir, status);

 	serial8250_modem_status(up);
 	if (status & UART_LSR_THRE && up->dma->tx_err) {
--
2.41.0


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

* Re: [PATCH] serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt
  2023-10-30 18:39 [PATCH] serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt Ronald Wahl
@ 2023-10-31  6:06 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2023-10-31  6:06 UTC (permalink / raw)
  To: Ronald Wahl
  Cc: linux-kernel, linux-serial, Vignesh Raghavendra,
	Ilpo Järvinen, Ronald Wahl

On Mon, Oct 30, 2023 at 07:39:51PM +0100, Ronald Wahl wrote:
> Starting RX DMA on THRI interrupt is too early because TX may not have
> finished yet.
> 
> This change is inspired by commit 90b8596ac460 ("serial: 8250: Prevent
> starting up DMA Rx on THRI interrupt") and fixes DMA issues I had with
> an AM62 SoC that is using the 8250 OMAP variant.
> 
> Signed-off-by: Ronald Wahl <ronald.wahl@raritan.com>
> ---
>  drivers/tty/serial/8250/8250_omap.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

What commit id does this fix?

thanks,

greg k-h

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

end of thread, other threads:[~2023-10-31  6:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-30 18:39 [PATCH] serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt Ronald Wahl
2023-10-31  6:06 ` Greg Kroah-Hartman

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