Skip to content

Commit 2790ce2

Browse files
Cheick Traoregregkh
authored andcommitted
serial: stm32: do not deassert RS485 RTS GPIO prematurely
If stm32_usart_start_tx is called with an empty xmit buffer, RTS GPIO could be deasserted prematurely, as bytes in TX FIFO are still transmitting. So this patch remove rts disable when xmit buffer is empty. Fixes: d7c7671 ("serial: stm32: Use TC interrupt to deassert GPIO RTS in RS485 mode") Cc: stable <stable@kernel.org> Signed-off-by: Cheick Traore <cheick.traore@foss.st.com> Link: https://lore.kernel.org/r/20250320152540.709091-1-cheick.traore@foss.st.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3d5390f commit 2790ce2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/tty/serial/stm32-usart.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -965,10 +965,8 @@ static void stm32_usart_start_tx(struct uart_port *port)
965965
{
966966
struct tty_port *tport = &port->state->port;
967967

968-
if (kfifo_is_empty(&tport->xmit_fifo) && !port->x_char) {
969-
stm32_usart_rs485_rts_disable(port);
968+
if (kfifo_is_empty(&tport->xmit_fifo) && !port->x_char)
970969
return;
971-
}
972970

973971
stm32_usart_rs485_rts_enable(port);
974972

0 commit comments

Comments
 (0)