[PATCH 0/2] tty: serial: lpuart: keep RTS deasserted while the port is being configured
From: Sherry Sun (OSS)
Date: Wed Oct 21 2026 - 23:13:49 EST
When hardware flow control is enabled, the RXRTSE bit in UARTMODIR makes
RTS follow the receiver FIFO level as long as the receiver is enabled.
In the lpuart32 code there are still two windows where RXRTSE is set
while the receiver is enabled but the port is not fully configured yet.
In both cases RTS can be asserted, so the remote side may keep sending,
or start sending, right before set_termios() disables the receiver and
reprograms the baud rate. The characters in flight are then lost or
corrupted, and a short RTS pulse can be observed on the line.
Patch 1 fixes set_termios(). Since commit e98ab45ec518 ("tty: serial:
lpuart: only disable CTS instead of overwriting the whole UARTMODIR
register"), the UARTMODIR write before waiting for transmission complete
only masks TXCTSE, so RXRTSE stays set, or is even newly set when
CRTSCTS is requested, while the receiver is still enabled. Mask RXRTSE
in that write as well; the final UARTMODIR write still restores the
flow control setting requested by termios.
Patch 2 fixes startup(). RXRTSE/TXCTSE keep their value from the
previous session, and lpuart32_startup() enables the receiver before
set_termios() is called, so RTS is asserted immediately on open and on
resume. Clear both bits at the beginning of lpuart32_startup() and leave
the flow control configuration to set_termios().
Signed-off-by: Sherry Sun <sherry.sun@xxxxxxx>
---
Sherry Sun (2):
tty: serial: lpuart: deassert RTS while reconfiguring in set_termios()
tty: serial: lpuart: disable hardware flow control in lpuart32_startup()
drivers/tty/serial/fsl_lpuart.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
---
base-commit: 8f7df005a7564bd7ffa75da9c3085d5b996f1e16
change-id: 20261022-b4-lpuart_rts_fix-730498ccb73d
Best regards,
--
Sherry Sun <sherry.sun@xxxxxxx>