]> git.baikalelectronics.ru Git - kernel.git/commit
printk: do not wait for consoles when suspended
authorJohn Ogness <john.ogness@linutronix.de>
Fri, 15 Jul 2022 06:10:42 +0000 (08:16 +0206)
committerPetr Mladek <pmladek@suse.com>
Fri, 15 Jul 2022 08:52:11 +0000 (10:52 +0200)
commit7eeddd02d0030f4e0add03fb263014eb502041c0
treece45ae54cb0696dc167787b35ba4df28e6017458
parent2786ce5808b41477c8f5a95402e773c57d037ef8
printk: do not wait for consoles when suspended

The console_stop() and console_start() functions call pr_flush().
When suspending, these functions are called by the serial subsystem
while the serial port is suspended. In this scenario, if there are
any pending messages, a call to pr_flush() will always result in a
timeout because the serial port cannot make forward progress. This
causes longer suspend and resume times.

Add a check in pr_flush() so that it will immediately timeout if
the consoles are suspended.

Fixes: 9f1bb52f90bb ("printk: add pr_flush()")
Reported-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Tested-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20220715061042.373640-2-john.ogness@linutronix.de
kernel/printk/printk.c