Skip to contentSkip to conversation

serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt

PATCH Superseded Ronald Wahl 2 participants 2 messages Oct 31, 2023 TTY layer and serial drivers

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 serial: 8250: 8250_omap: Do not start RX DMA on THRI interrupt

From: Ronald Wahl <[email protected]>

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.

Fixes c26389f998a8 ("serial: 8250: 8250_omap: Add DMA support for UARTs on K3 SoCs")

---
V2: - add Fixes: tag
- fix author

 drivers/tty/serial/8250/8250_omap.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/tty/serial/8250/8250_omap.c +5 -4
index c7ab2963040b..f2f59ec6b50b 100644
@@ -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

#1 lore raw
Quoted 39 lines · Ronald Wahl

From: Ronald Wahl <[email protected]>

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.

Fixes c26389f998a8 ("serial: 8250: 8250_omap: Add DMA support for UARTs on K3 SoCs")

---
V2: - add Fixes: tag
- fix author

 drivers/tty/serial/8250/8250_omap.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/tty/serial/8250/8250_omap.c +5 -5
index c7ab2963040b..f2f59ec6b50b 100644
@@ -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) {
--
Quoted 2 lines

2.41.0

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.

You are receiving this message because of the following common error(s) as indicated below:

- You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this.

If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.

thanks,

greg k-h's patch email bot