]> git.hungrycats.org Git - linux/commit
serial: 8250: Ignore flow control on suspend/resume with no_console_suspend
authorJohn Ogness <john.ogness@linutronix.de>
Tue, 7 Jul 2026 14:10:04 +0000 (16:16 +0206)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Sep 2026 11:36:16 +0000 (13:36 +0200)
commit65d97c3d9060faa6b623b49203afe94f53f27c29
tree0c801d0f15eb625dc61462fd5361eea2db3d0e4c
parenta79848859b1a82937ced219e7507f4e7889af751
serial: 8250: Ignore flow control on suspend/resume with no_console_suspend

[ Upstream commit 302fbbb4fcbdeac2dc8c63a56c1c4e38c4781958 ]

If no_console_suspend is specified, on suspend the 8250 console driver
uses a scratch register (UART_SCR) to store a special canary value. This
is used during the resume path to identify a printk() call before the
driver's own ->resume() callback. In this case,
serial8250_console_restore() is called to quickly re-init the 8250 for
console printing.

See commit 4516d50aabed ("serial: 8250: Use canary to restart console after
suspend") for the original motivation.

Unfortunately, this canary workaround does not work in all cases (such as
suspend to mem) because the scratch register will not reset. This has not
been a real issue until now because it could simply lead to some garbage
characters upon resume. However, with the introduction of console flow
control it becomes a real problem because a failed suspend/resume detection
when flow control is enabled leads to all characters hitting the flow
control timeout.

Workaround this issue by temporarily ignoring console flow control when
the debug canary suspend/resume detection is active.

Fixes: 5e6dfb87b191 ("serial: 8250: Add support for console flow control")
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Link: https://patch.msgid.link/20260707141032.5074-1-john.ogness@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/8250/8250_port.c