Skip to contentSkip to conversation

Revert "serial: 8250: Clear CON_PRINTBUFFER on port re-registration"

PATCH Superseded Fushuai Wang 3 participants 5 messages Jul 24 – Jul 30 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Revert "serial: 8250: Clear CON_PRINTBUFFER on port re-registration"

From: Fushuai Wang <[email protected]>

This reverts commit d338ab1d90603f875c4f7ed223406535378173a5.

uart_console() only indicates that the port is selected as the console. It does not mean that the console has already been registered or has printed the buffered messages.

On platforms where an initial 8250 port is replaced when the real UART device is registered, clearing CON_PRINTBUFFER causes the console to start at the end of the printk ring buffer. Without earlycon, all messages logged before UART registration are therefore lost.

---

The reverted commit is currently in tty/tty-next and tty/tty-testing, and has appeared in linux-next since next-20260717.

v1->v2: Expand the commit message with detailed explanation of the regression.

 drivers/tty/serial/8250/8250_core.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/tty/serial/8250/8250_core.c +1 -5
index c0e8a4efbdcc..f49862d90eeb 100644
@@ -720,12 +720,8 @@ int serial8250_register_8250_port(const struct uart_8250_port *up)
 	/* Preserve specified console flow control. */
 	cons_flow = uart_cons_flow_enabled(&uart->port);
 
-	if (uart->port.dev) {
-		if (uart_console(&uart->port))
-			uart->port.cons->flags &= ~CON_PRINTBUFFER;
-
+	if (uart->port.dev)
 		uart_remove_one_port(&serial8250_reg, &uart->port);
-	}
 
 	uart->port.ctrl_id	= up->port.ctrl_id;
 	uart->port.port_id	= up->port.port_id;
Signature · 1 line
2.36.1
#1 lore raw
Quoted 7 lines · Fushuai Wang

From: Fushuai Wang <[email protected]>

This reverts commit d338ab1d90603f875c4f7ed223406535378173a5.

uart_console() only indicates that the port is selected as the console. It does not mean that the console has already been registered or has printed the buffered messages.

The multi-system boot regression this fixes is still present in -next.

#2 lore raw

PATCH v2 1/1 Revert "serial: 8250: Clear CON_PRINTBUFFER on port re-registration"

Quoted 9 lines
Quoted 7 lines

From: Fushuai Wang <[email protected]>

This reverts commit d338ab1d90603f875c4f7ed223406535378173a5.

uart_console() only indicates that the port is selected as the console. It does not mean that the console has already been registered or has printed the buffered messages.

The multi-system boot regression this fixes is still present in -next.

Hi, Greg

Just a ping.

Mark has confirmed that the regression is still present in -next. Could you please take a look and consider applying it to tty/tty-testing and tty/tty-next?

Signature · 2 lines
Regards,
Fushuai
maintainer
#3 lore raw
Quoted 10 lines · Fushuai Wang
Quoted 9 lines
Quoted 7 lines

From: Fushuai Wang <[email protected]>

This reverts commit d338ab1d90603f875c4f7ed223406535378173a5.

uart_console() only indicates that the port is selected as the console. It does not mean that the console has already been registered or has printed the buffered messages.

The multi-system boot regression this fixes is still present in -next.

Quoted 7 lines

Hi, Greg

Just a ping.

Mark has confirmed that the regression is still present in -next. Could you please take a look and consider applying it to tty/tty-testing and tty/tty-next?

Will do, working on my patch queue right now...

maintainer
#4 lore raw
Quoted 13 lines · Greg KH
Quoted 12 lines · Fushuai Wang
Quoted 9 lines
Quoted 7 lines

From: Fushuai Wang <[email protected]>

This reverts commit d338ab1d90603f875c4f7ed223406535378173a5.

uart_console() only indicates that the port is selected as the console. It does not mean that the console has already been registered or has printed the buffered messages.

The multi-system boot regression this fixes is still present in -next.

Hi, Greg

Quoted 8 lines
Quoted 5 lines

Just a ping.

Mark has confirmed that the regression is still present in -next. Could you please take a look and consider applying it to tty/tty-testing and tty/tty-next?

Will do, working on my patch queue right now...

Sorry for the delay, now queued up.

greg k-h