diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2014-06-16 09:17:09 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-10 16:07:46 -0700 |
commit | c18b55fd1717a4c08c9f3555be63da142767e6b8 (patch) | |
tree | 032503380052ca7646935f75b7415563b7e3797f /drivers/tty/serial | |
parent | 7c6d340f4f0e889b134fd72f203519f591feef9d (diff) |
tty: serial: Fix termios/port flags mismatch
Uart port drivers may reconfigure termios settings based on available
hardware support; set/clear ASYNC_CTS_FLOW and ASYNC_CHECK_CD _after_
calling the port driver's .set_termios method.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r-- | drivers/tty/serial/serial_core.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 1a5fbf7ab347..b70095e55df6 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -450,6 +450,7 @@ static void uart_change_speed(struct tty_struct *tty, struct uart_state *state, return; termios = &tty->termios; + uport->ops->set_termios(uport, termios, old_termios); /* * Set flags based on termios cflag @@ -463,8 +464,6 @@ static void uart_change_speed(struct tty_struct *tty, struct uart_state *state, clear_bit(ASYNCB_CHECK_CD, &port->flags); else set_bit(ASYNCB_CHECK_CD, &port->flags); - - uport->ops->set_termios(uport, termios, old_termios); } static inline int __uart_put_char(struct uart_port *port, @@ -1282,6 +1281,8 @@ static void uart_set_termios(struct tty_struct *tty, } uart_change_speed(tty, state, old_termios); + /* reload cflag from termios; port driver may have overriden flags */ + cflag = tty->termios.c_cflag; /* Handle transition to B0 status */ if ((old_termios->c_cflag & CBAUD) && !(cflag & CBAUD)) |