]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
serial: mvebu-uart: Fix local flags handling on termios update
authorMarc Zyngier <marc.zyngier@arm.com>
Sun, 22 Apr 2018 12:33:46 +0000 (13:33 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:24:42 +0000 (12:24 +0200)
commitc39159de48b28ab52c75c0530b730c3ce69e7b3b
treee174387f263f78dbb90badbfdc82fc70d084b0f4
parent64f7a1225e4e8d5bd5ee29878850277ec6c2e5c3
serial: mvebu-uart: Fix local flags handling on termios update

BugLink: http://bugs.launchpad.net/bugs/1778265
commit 46c6975a1fd9794ed979565235d24b2f5004e014 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/tty/serial/mvebu-uart.c