]>
Commit | Line | Data |
---|---|---|
ab2dc296 GKH |
1 | From e0bf2d4982fe7d9ddaf550dd023803ea286f47fc Mon Sep 17 00:00:00 2001 |
2 | From: Jan Kiszka <jan.kiszka@siemens.com> | |
3 | Date: Sun, 26 Aug 2018 19:49:32 +0200 | |
4 | Subject: serial: mvebu-uart: Fix reporting of effective CSIZE to userspace | |
5 | ||
6 | From: Jan Kiszka <jan.kiszka@siemens.com> | |
7 | ||
8 | commit e0bf2d4982fe7d9ddaf550dd023803ea286f47fc upstream. | |
9 | ||
10 | Apparently, this driver (or the hardware) does not support character | |
11 | length settings. It's apparently running in 8-bit mode, but it makes | |
12 | userspace believe it's in 5-bit mode. That makes tcsetattr with CS8 | |
13 | incorrectly fail, breaking e.g. getty from busybox, thus the login shell | |
14 | on ttyMVx. | |
15 | ||
16 | Fix by hard-wiring CS8 into c_cflag. | |
17 | ||
18 | Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> | |
19 | Fixes: 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port") | |
20 | Cc: stable <stable@vger.kernel.org> # 4.6+ | |
21 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
22 | ||
23 | --- | |
24 | drivers/tty/serial/mvebu-uart.c | 4 +++- | |
25 | 1 file changed, 3 insertions(+), 1 deletion(-) | |
26 | ||
27 | --- a/drivers/tty/serial/mvebu-uart.c | |
28 | +++ b/drivers/tty/serial/mvebu-uart.c | |
29 | @@ -327,8 +327,10 @@ static void mvebu_uart_set_termios(struc | |
30 | if ((termios->c_cflag & CREAD) == 0) | |
31 | port->ignore_status_mask |= STAT_RX_RDY | STAT_BRK_ERR; | |
32 | ||
33 | - if (old) | |
34 | + if (old) { | |
35 | tty_termios_copy_hw(termios, old); | |
36 | + termios->c_cflag |= CS8; | |
37 | + } | |
38 | ||
39 | baud = uart_get_baud_rate(port, termios, old, 0, 460800); | |
40 | uart_update_timeout(port, termios->c_cflag, baud); |