summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheick Traore <cheick.traore@foss.st.com>2025-03-20 16:25:40 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-04-07 10:08:36 +0200
commit5f9176f82ec7d9f66f3892a330126de4ef66c2d6 (patch)
tree38ac0183f964bc5939dc3ec19927265f202397ec
parentf86907583000c605bb2b1400ca77f2865aecc3c4 (diff)
downloadlinux-5f9176f82ec7d9f66f3892a330126de4ef66c2d6.tar.gz
linux-5f9176f82ec7d9f66f3892a330126de4ef66c2d6.tar.bz2
linux-5f9176f82ec7d9f66f3892a330126de4ef66c2d6.zip
serial: stm32: do not deassert RS485 RTS GPIO prematurely
commit 2790ce23951f0c497810c44ad60a126a59c8d84c upstream. 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: d7c76716169d ("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>
-rw-r--r--drivers/tty/serial/stm32-usart.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/tty/serial/stm32-usart.c b/drivers/tty/serial/stm32-usart.c
index f5199fdecff2..9b9981352b1e 100644
--- a/drivers/tty/serial/stm32-usart.c
+++ b/drivers/tty/serial/stm32-usart.c
@@ -965,10 +965,8 @@ static void stm32_usart_start_tx(struct uart_port *port)
{
struct tty_port *tport = &port->state->port;
- if (kfifo_is_empty(&tport->xmit_fifo) && !port->x_char) {
- stm32_usart_rs485_rts_disable(port);
+ if (kfifo_is_empty(&tport->xmit_fifo) && !port->x_char)
return;
- }
stm32_usart_rs485_rts_enable(port);