summaryrefslogtreecommitdiff
path: root/include/linux/console.h
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2023-07-17 21:52:06 +0206
committerPetr Mladek <pmladek@suse.com>2023-07-20 13:06:22 +0200
commit9e70a5e109a4a23367810de09be826c52d27ee2f (patch)
treeba589f9ff3687ef952bc5a4c300f1d6af2b65a05 /include/linux/console.h
parent696ffaf50e1f8dbc66223ff614473f945f5fb8d8 (diff)
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
Diffstat (limited to 'include/linux/console.h')
-rw-r--r--include/linux/console.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/console.h b/include/linux/console.h
index d3195664baa5..7de11c763eb3 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -154,6 +154,8 @@ static inline int con_debug_leave(void)
* receiving the printk spam for obvious reasons.
* @CON_EXTENDED: The console supports the extended output format of
* /dev/kmesg which requires a larger output buffer.
+ * @CON_SUSPENDED: Indicates if a console is suspended. If true, the
+ * printing callbacks must not be called.
*/
enum cons_flags {
CON_PRINTBUFFER = BIT(0),
@@ -163,6 +165,7 @@ enum cons_flags {
CON_ANYTIME = BIT(4),
CON_BRL = BIT(5),
CON_EXTENDED = BIT(6),
+ CON_SUSPENDED = BIT(7),
};
/**