]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.9.132/serial-mvebu-uart-fix-reporting-of-effective-csize-to-userspace.patch
Linux 4.14.95
[thirdparty/kernel/stable-queue.git] / releases / 4.9.132 / serial-mvebu-uart-fix-reporting-of-effective-csize-to-userspace.patch
CommitLineData
ab2dc296
GKH
1From e0bf2d4982fe7d9ddaf550dd023803ea286f47fc Mon Sep 17 00:00:00 2001
2From: Jan Kiszka <jan.kiszka@siemens.com>
3Date: Sun, 26 Aug 2018 19:49:32 +0200
4Subject: serial: mvebu-uart: Fix reporting of effective CSIZE to userspace
5
6From: Jan Kiszka <jan.kiszka@siemens.com>
7
8commit e0bf2d4982fe7d9ddaf550dd023803ea286f47fc upstream.
9
10Apparently, this driver (or the hardware) does not support character
11length settings. It's apparently running in 8-bit mode, but it makes
12userspace believe it's in 5-bit mode. That makes tcsetattr with CS8
13incorrectly fail, breaking e.g. getty from busybox, thus the login shell
14on ttyMVx.
15
16Fix by hard-wiring CS8 into c_cflag.
17
18Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
19Fixes: 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port")
20Cc: stable <stable@vger.kernel.org> # 4.6+
21Signed-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);