[PATCH v4 7/7] serial: rsci: Simplify rsci_transmit_chars()
From: Diogo Ivo
Date: Fri Nov 13 2026 - 15:00:02 EST
Now that sci_er_interrupt() no longer calls sci_tx_interrupt() on RSCI
ports, rsci_transmit_chars() is only invoked when CSR.TDRE and CCR0.TE
are set.
Drop the redundant CCR0.TIE manipulation in the !CSR_TDRE guard and
call rsci_stop_tx() instead of open-coding the CCR0.TIE/CCR0.TEIE
update when transmission stops.
Signed-off-by: Diogo Ivo <diogo.ivo.sx@xxxxxxxxxxx>
---
drivers/tty/serial/rsci.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/tty/serial/rsci.c b/drivers/tty/serial/rsci.c
index 05703bb31afd..80087be11808 100644
--- a/drivers/tty/serial/rsci.c
+++ b/drivers/tty/serial/rsci.c
@@ -432,19 +432,12 @@ static void rsci_transmit_chars(struct uart_port *port)
{
unsigned int stopped = uart_tx_stopped(port);
struct tty_port *tport = &port->state->port;
- u32 status, ctrl;
+ u32 status;
int count;
status = rsci_serial_in(port, CSR);
- if (!(status & CSR_TDRE)) {
- ctrl = rsci_serial_in(port, CCR0);
- if (kfifo_is_empty(&tport->xmit_fifo))
- ctrl &= ~CCR0_TIE;
- else
- ctrl |= CCR0_TIE;
- rsci_serial_out(port, CCR0, ctrl);
+ if (!(status & CSR_TDRE))
return;
- }
count = rsci_txroom(port);
@@ -467,12 +460,8 @@ static void rsci_transmit_chars(struct uart_port *port)
if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS)
uart_write_wakeup(port);
- if (kfifo_is_empty(&tport->xmit_fifo) || stopped) {
- ctrl = rsci_serial_in(port, CCR0);
- ctrl &= ~CCR0_TIE;
- ctrl |= CCR0_TEIE;
- rsci_serial_out(port, CCR0, ctrl);
- }
+ if (kfifo_is_empty(&tport->xmit_fifo) || stopped)
+ rsci_stop_tx(port);
}
static void rsci_receive_chars(struct uart_port *port)
--
2.56.0