diff mbox series

[v2,3/6] serial: core: fully suppress raising DTR & RTS on open if nordy is set

Message ID 20220531043701.7AA40374023D@freecalypso.org
State New
Headers show
Series [v2,1/6] tty: add port flag to suppress ready signalling on open | expand

Commit Message

Mychaela N. Falconia May 31, 2022, 4:37 a.m. UTC
When nordy sysfs attribute is written as 1, TTY_PORT_NORDY is set,
and the call to raise DTR & RTS in tty_port_raise_dtr_rts() is
suppressed.  However, there is one other place where these signals
are also raised on open: uart_port_startup() in
drivers/tty/serial/serial_core.c - this other point of raising
DTR & RTS also needs to be suppressed if TTY_PORT_NORDY is set.

Signed-off-by: Mychaela N. Falconia <falcon@freecalypso.org>
---
 drivers/tty/serial/serial_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index a17ac4efaceb..2a558813afa1 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -236,7 +236,7 @@  static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
 		 * Setup the RTS and DTR signals once the
 		 * port is open and ready to respond.
 		 */
-		if (init_hw && C_BAUD(tty))
+		if (init_hw && !tty_port_nordy(&state->port) && C_BAUD(tty))
 			uart_port_dtr_rts(uport, 1);
 	}