From nobody Sun May 24 18:41:00 2026 Received: from out-188.mta1.migadu.com (out-188.mta1.migadu.com [95.215.58.188]) (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 DBCB03C585E for ; Fri, 22 May 2026 10:11:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.188 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779444697; cv=none; b=EUJjo0j8vyGBBPPQxW7vOwTB41KFnAORPs9kKJ9KlpmuZ4DqghNAhcHvCA0OvOGyyVbiFUQY2UrHIbXm5WDv/W880mQuA/ft2l5yN8lUAaqtmtT1TARGXIj60Fk9Z5+G5JdXINFuIrQ9g60X4CssR+0yz+bQskAZrVSRKKYF87A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779444697; c=relaxed/simple; bh=hAUOTYYF2qflRHSX1eXQBgemUvoaD5gB7ZQ5XP637tI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ey3sIkMuneWIAT+cbyEj8DRH9l7ImrJKd4RfeGBbZ08lQD97x3ANpb3YMYmLPnDoBPGaKQ0rQQIPseHKuVTYzJFNxAs4LvJINw1gEt9OIeXok4Sf8Uhvt/Hel3DTKfx9sWt9PQ7873FmCLVCHJGIss/VX24c2/DhvfcnrKF5aaI= 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=wDGZi3Em; arc=none smtp.client-ip=95.215.58.188 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="wDGZi3Em" 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=1779444692; 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=lpkuygLNHaOjLCNnLzzQ1qT5MhYOdC42n0Q9Eo6AsCI=; b=wDGZi3EmmsX3sOVnMZIzETiZgmIV0FalADMsc5UM6Mq5/QiVzb7aPObp7aXlxUArNvYG+N pQ4xgtDCgLaD2AH1x7C1l63eEDf68Pi1es7O9uniOBwbyuejdz4jEHNPsSEuy6qVtpJdBC CdqGU8nyVZdGQg3xdLYunB3K4i6Twd0= From: Fushuai Wang To: gregkh@linuxfoundation.org, jirislaby@kernel.org, ilpo.jarvinen@linux.intel.com, osama.abdelkader@gmail.com, andy.shevchenko@gmail.com, jackzxcui1989@163.com, kees@kernel.org, sean@mess.org, alan@linux.intel.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, wangfushuai@baidu.com Subject: [PATCH v3] serial: 8250: Clear CON_PRINTBUFFER on port re-registration Date: Fri, 22 May 2026 18:10:42 +0800 Message-Id: <20260522101042.21976-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 When two PnP devices map to the same physical port, the serial8250 driver removes and re-registers the console structure for the same port. During re-registration, the console structure still has CON_PRINTBUFFER set from the initial registration, which causes console_init_seq() to set console->seq to syslog_seq. This results in re-printing the entire system log buffer, which may lead to RCU stall on slow serial consoles. Clear CON_PRINTBUFFER when re-registering a port to prevent duplicate log printing. Fixes: 835d844d1a28 ("8250_pnp: do pnp probe before legacy probe") Suggested-by: Greg Kroah-Hartman Signed-off-by: Fushuai Wang --- V2->V3: Clear CON_PRINTBUFFER when remove the port V1->V2: Add Fixes tag drivers/tty/serial/8250/8250_core.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/= 8250_core.c index a428e88938eb..5419f1d22d47 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -716,8 +716,12 @@ int serial8250_register_8250_port(const struct uart_82= 50_port *up) if (uart->port.type =3D=3D PORT_8250_CIR) return -ENODEV; =20 - if (uart->port.dev) + if (uart->port.dev) { + if (uart_console(&uart->port)) + uart->port.cons->flags &=3D ~CON_PRINTBUFFER; + 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