Commit cdb2d37d authored by Jan Kiszka's avatar Jan Kiszka Committed by Greg Kroah-Hartman

serial: mvebu-uart: Fix reporting of effective CSIZE to userspace

commit e0bf2d49 upstream.

Apparently, this driver (or the hardware) does not support character
length settings. It's apparently running in 8-bit mode, but it makes
userspace believe it's in 5-bit mode. That makes tcsetattr with CS8
incorrectly fail, breaking e.g. getty from busybox, thus the login shell
on ttyMVx.

Fix by hard-wiring CS8 into c_cflag.
Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
Fixes: 30530791 ("serial: mvebu-uart: initial support for Armada-3700 serial port")
Cc: stable <stable@vger.kernel.org> # 4.6+
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a17e2a72
...@@ -327,8 +327,10 @@ static void mvebu_uart_set_termios(struct uart_port *port, ...@@ -327,8 +327,10 @@ static void mvebu_uart_set_termios(struct uart_port *port,
if ((termios->c_cflag & CREAD) == 0) if ((termios->c_cflag & CREAD) == 0)
port->ignore_status_mask |= STAT_RX_RDY | STAT_BRK_ERR; port->ignore_status_mask |= STAT_RX_RDY | STAT_BRK_ERR;
if (old) if (old) {
tty_termios_copy_hw(termios, old); tty_termios_copy_hw(termios, old);
termios->c_cflag |= CS8;
}
baud = uart_get_baud_rate(port, termios, old, 0, 460800); baud = uart_get_baud_rate(port, termios, old, 0, 460800);
uart_update_timeout(port, termios->c_cflag, baud); uart_update_timeout(port, termios->c_cflag, baud);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment