From f99134904e109dda0d43c0373ec994ded17f5345 Mon Sep 17 00:00:00 2001 From: Huibin Hong Date: Fri, 26 Apr 2024 10:25:00 +0800 Subject: [PATCH] serial: 8250: fix bug rts is inactive when auto flow is enable To save mcr value when uart is reset for setting baudrate. Change-Id: I1a4fcd78498cf4f601d0c8461d1db67dc0ed6f9e Signed-off-by: Huibin Hong --- drivers/tty/serial/8250/8250_port.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index e82660994fba..4a9a8c081c92 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2712,6 +2712,7 @@ void serial8250_do_set_divisor(struct uart_port *port, unsigned int baud, struct uart_8250_port *up = up_to_u8250p(port); #ifdef CONFIG_ARCH_ROCKCHIP + int mcr = serial_port_in(port, UART_MCR); serial_port_out(port, UART_MCR, UART_MCR_LOOP); #endif /* Workaround to enable 115200 baud on OMAP1510 internal ports */ @@ -2741,7 +2742,7 @@ void serial8250_do_set_divisor(struct uart_port *port, unsigned int baud, if (port->type != PORT_16750) serial_port_out(port, UART_LCR, up->lcr); /* reset DLAB */ - serial_port_out(port, UART_MCR, up->mcr); + serial_port_out(port, UART_MCR, mcr); #endif } EXPORT_SYMBOL_GPL(serial8250_do_set_divisor);