Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0bf2d49 authored by Jan Kiszka's avatar Jan Kiszka Committed by Greg Kroah-Hartman
Browse files

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



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 7876320f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -511,6 +511,7 @@ 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_cflag |= CS8;
	}

	spin_unlock_irqrestore(&port->lock, flags);