printk: Add per-console suspended state
authorJohn Ogness <john.ogness@linutronix.de>
Mon, 17 Jul 2023 19:46:06 +0000 (21:52 +0206)
committerPetr Mladek <pmladek@suse.com>
Thu, 20 Jul 2023 11:06:22 +0000 (13:06 +0200)
commit9e70a5e109a4a23367810de09be826c52d27ee2f
treeba589f9ff3687ef952bc5a4c300f1d6af2b65a05
parent696ffaf50e1f8dbc66223ff614473f945f5fb8d8
printk: Add per-console suspended state

Currently the global @console_suspended is used to determine if
consoles are in a suspended state. Its primary purpose is to allow
usage of the console_lock when suspended without causing console
printing. It is synchronized by the console_lock.

Rather than relying on the console_lock to determine suspended
state, make it an official per-console state that is set within
console->flags. This allows the state to be queried via SRCU.

Remove @console_suspended. Console printing will still be avoided
when suspended because console_is_usable() returns false when
the new suspended flag is set for that console.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20230717194607.145135-7-john.ogness@linutronix.de
include/linux/console.h
kernel/printk/printk.c