This reverts commit f45709df7731ad36306a28a3e1af7309d55c35f5. The `serial8250_do_set_mctrl` not only used by userspace ioctl but also the kernel itself. During tty_open, the uart_port_startup sets the MCR to 0, and then use set_mctrl to restore the MCR, so at this time, the MCR read does not reflect the desired value. Signed-off-by: Su Bao Cheng <baocheng.su@xxxxxxxxxxx> --- drivers/tty/serial/8250/8250_port.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 66374704747e..40736e460956 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2024,13 +2024,6 @@ void serial8250_do_set_mctrl(struct uart_port *port, unsigned int mctrl) struct uart_8250_port *up = up_to_u8250p(port); unsigned char mcr; - if (port->rs485.flags & SER_RS485_ENABLED) { - if (serial8250_in_MCR(up) & UART_MCR_RTS) - mctrl |= TIOCM_RTS; - else - mctrl &= ~TIOCM_RTS; - } - mcr = serial8250_TIOCM_to_MCR(mctrl); mcr = (mcr & up->mcr_mask) | up->mcr_force | up->mcr; -- 2.25.1