summaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2018-04-22 13:33:46 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-04-22 17:35:31 +0200
commit46c6975a1fd9794ed979565235d24b2f5004e014 (patch)
treecd8822bc213f648b549ac648b744f4d7e6935711 /drivers/tty
parentb2d89ad9c9682e795ed6eeb9ed455789ad6cedf1 (diff)
downloadop-kernel-dev-46c6975a1fd9794ed979565235d24b2f5004e014.zip
op-kernel-dev-46c6975a1fd9794ed979565235d24b2f5004e014.tar.gz
serial: mvebu-uart: Fix local flags handling on termios update
Commit 68a0db1d7da2 reworked the baud rate selection, but also added a (not so) subtle change in the way the local flags (c_lflag in the termios structure) are handled, forcing the new flags to always be the same as the old ones. The reason for that particular change is both obscure and undocumented. It also completely breaks userspace. Something as trivial as getty is unusable: <example> Debian GNU/Linux 9 sy-borg ttyMV0 sy-borg login: root root [timeout] Debian GNU/Linux 9 sy-borg ttyMV0 </example> which is quite obvious in retrospect: getty cannot get in control of the echo mode, is stuck in canonical mode, and times out without ever seeing anything valid. It also begs the question of how this change was ever tested. The fix is pretty obvious: stop messing with c_lflag, and the world will be a happier place. Cc: stable@vger.kernel.org # 4.15+ Fixes: 68a0db1d7da2 ("serial: mvebu-uart: add function to change baudrate") Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/mvebu-uart.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
index 750e564..f503fab 100644
--- a/drivers/tty/serial/mvebu-uart.c
+++ b/drivers/tty/serial/mvebu-uart.c
@@ -495,7 +495,6 @@ static void mvebu_uart_set_termios(struct uart_port *port,
termios->c_iflag |= old->c_iflag & ~(INPCK | IGNPAR);
termios->c_cflag &= CREAD | CBAUD;
termios->c_cflag |= old->c_cflag & ~(CREAD | CBAUD);
- termios->c_lflag = old->c_lflag;
}
spin_unlock_irqrestore(&port->lock, flags);
OpenPOWER on IntegriCloud