Skip to contentSkip to conversation

FAILED: patch "[PATCH] serial: mvebu-uart: Fix reporting of effective CSIZE to" failed to apply to 4.14-stable tree

PATCH In review [email protected] 2 participants 3 messages Sep 30, 2018 – Oct 5, 2018

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

Quoted 1 line

From e0bf2d4982fe7d9ddaf550dd023803ea286f47fc Mon Sep 17 00:00:00 2001

From: Jan Kiszka <[email protected]>
Date: Sun, 26 Aug 2018 19:49:32 +0200
Subject: [PATCH] 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.

Fixes 30530791a7a0 ("serial: mvebu-uart: initial support for Armada-3700 serial port")
Cc stable <[email protected]> # 4.6+
drivers/tty/serial/mvebu-uart.c +1 -0
index d04b5eeea3c6..170e446a2f62 100644
@@ -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);
#1 lore raw

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

From: Jan Kiszka <[email protected]>

Commit e0bf2d4982fe7d9ddaf550dd023803ea286f47fc 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.

---
 drivers/tty/serial/mvebu-uart.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/tty/serial/mvebu-uart.c +3 -1
index 45b57c294d13..401c983ec5f3 100644
@@ -327,8 +327,10 @@ static void mvebu_uart_set_termios(struct uart_port *port,
 	if ((termios->c_cflag & CREAD) == 0)
 		port->ignore_status_mask |= STAT_RX_RDY | STAT_BRK_ERR;
 
-	if (old)
+	if (old) {
 		tty_termios_copy_hw(termios, old);
+		termios->c_cflag |= CS8;
+	}
 
 	baud = uart_get_baud_rate(port, termios, old, 0, 460800);
 	uart_update_timeout(port, termios->c_cflag, baud);
Signature · 1 line
2.16.4
author maintainer
#2 lore raw

Re: [PATCH 4.9/4.14] serial: mvebu-uart: Fix reporting of effective CSIZE to userspace

Quoted 10 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

Commit e0bf2d4982fe7d9ddaf550dd023803ea286f47fc 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.

Quoted 6 lines

Fix by hard-wiring CS8 into c_cflag.

---
 drivers/tty/serial/mvebu-uart.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Now applied, thanks.

greg k-h