[PATCH v4 4/7] serial: sh-sci: Do not kick TX from sci_er_interrupt() on RSCI

From: Diogo Ivo

Date: Fri Nov 13 2026 - 13:55:16 EST


On RSCI, the receive error interrupt (ERI) has its own dedicated
interrupt line and status flags cleared via the write-only CFCLR
register, with no hardware interaction with transmission.

Calling sci_tx_interrupt() from sci_er_interrupt() on RSCI is
unnecessary and causes rsci_transmit_chars() to run in invalid TX
states:
- If an RX error occurs while TX is idle (CCR0.TE == 0 and CSR.TDRE == 1)
and xmit_fifo is empty, rsci_transmit_chars() sets CCR0.TEIE while
CSR.TEND is 1, triggering a spurious TEI interrupt.
- If an RX error occurs while the hardware TX FIFO is draining
(CSR.TDRE == 0) after xmit_fifo was flushed, rsci_transmit_chars()
clears CCR0.TIE without setting CCR0.TEIE, leaving CCR0.TE set after
the hardware FIFO drains and stalling subsequent transmissions.

Skip calling sci_tx_interrupt() in sci_er_interrupt() for RSCI ports.

Fixes: 0666e3fe95ab ("serial: sh-sci: Add support for RZ/T2H SCI")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Diogo Ivo <diogo.ivo.sx@xxxxxxxxxxx>
---
drivers/tty/serial/sh-sci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index 6df25fef5a5f..39aa90131918 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -2103,7 +2103,7 @@ static irqreturn_t sci_er_interrupt(int irq, void *ptr)
s->ops->clear_SCxSR(port, SCxSR_ERROR_CLEAR(port));

/* Kick the transmission */
- if (!s->chan_tx)
+ if (!s->chan_tx && !sci_is_rsci_type(s->type))
sci_tx_interrupt(irq, ptr);

return IRQ_HANDLED;

--
2.56.0