From nobody Fri Jul 24 21:52:35 2026 Received: from out-186.mta0.migadu.com (out-186.mta0.migadu.com [91.218.175.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8336841D215 for ; Fri, 24 Jul 2026 09:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.186 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784885546; cv=none; b=NukDOubCcuirBGyQi4htIF5208RDFeKBw9SdKW6pxFBCvHmKN/gxtSL6kM9OpaSX6dWMwl/JV2GGJcI1W6t0l9dRrRqWiaqvGC/NtibDi3cl3pq9u4ZEssDcg/KW41+Jj6qJjXEknMGZSrKs5fFs74pFCwIAlkw3DN6tgfF5iE4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784885546; c=relaxed/simple; bh=7hV4JPOT2HYRhZDtAzM2Jia/QBdg0LWZajGAq/IvQt8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=UrWlJlxZh/ek0nM2e9/kjD5/bG8ka6fOmRUtwfDjXate7s0oZGVPGY0Pm7T0uJVAYh//vBJX0WeH/AcMEjoSP4WZYDBZJaVKhVNKit/B5k/MlFnCDOGcRN2Zb3y4KtU4LW18tskEs76iT1Yoo2M0zIROJM25xiiUL+0kyOQ2RwU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=HUCMFugq; arc=none smtp.client-ip=91.218.175.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="HUCMFugq" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1784885529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=TdyWUbYwd+tGnxrMPNIHdo/fsQia1BgdcGkErM6IEk4=; b=HUCMFugquDENTYxkKv/bQNAZO0XyjOQcUKU+d+nvUNTGMFryNHVU/KJtX7XjepTC/UpmAB gym2nfhVGmVgzwJeuMYJ6j2ccR8L/n1ofDln+3pmtNrPlJ59OQLLD/q/05Xd1dGOcCLxEr ADL23GCG5B8kYKgXBdPQy6ZkkkAa0zU= From: Fushuai Wang To: gregkh@linuxfoundation.org, jirislaby@kernel.org, john.ogness@linutronix.de, osama.abdelkader@gmail.com, jackzxcui1989@163.com, asrinivasan@oss.tenstorrent.com, andy.shevchenko@gmail.com, broonie@kernel.org Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Fushuai Wang Subject: [PATCH v2] Revert "serial: 8250: Clear CON_PRINTBUFFER on port re-registration" Date: Fri, 24 Jul 2026 17:31:51 +0800 Message-Id: <20260724093151.53216-1-fushuai.wang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Fushuai Wang 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. Reported-by: Mark Brown Reported-by: Anirudh Srinivasan Link: https://lore.kernel.org/all/20260522101042.21976-1-fushuai.wang@linux= .dev/ Signed-off-by: Fushuai Wang Reviewed-by: John Ogness --- 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 regressi= on. drivers/tty/serial/8250/8250_core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/= 8250_core.c index c0e8a4efbdcc..f49862d90eeb 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -720,12 +720,8 @@ int serial8250_register_8250_port(const struct uart_82= 50_port *up) /* Preserve specified console flow control. */ cons_flow =3D uart_cons_flow_enabled(&uart->port); =20 - if (uart->port.dev) { - if (uart_console(&uart->port)) - uart->port.cons->flags &=3D ~CON_PRINTBUFFER; - + if (uart->port.dev) uart_remove_one_port(&serial8250_reg, &uart->port); - } =20 uart->port.ctrl_id =3D up->port.ctrl_id; uart->port.port_id =3D up->port.port_id; --=20 2.36.1