printk: Introduce FORCE_CON flag
authorMarcos Paulo de Souza <mpdesouza@suse.com>
Tue, 5 Nov 2024 19:45:08 +0000 (16:45 -0300)
committerPetr Mladek <pmladek@suse.com>
Mon, 11 Nov 2024 11:53:31 +0000 (12:53 +0100)
commited76c07c6885b249ce8486dac22fb97151a83185
tree561f88a4019769122c588316516f0dc1172313dc
parentc903327d3295b135eb8c81ebe0b68c1837718eb8
printk: Introduce FORCE_CON flag

Introduce FORCE_CON flag to printk. The new flag will make it possible to
create a context where printk messages will never be suppressed.

This mechanism will be used in the next patch to create a force_con
context on sysrq handling, removing an existing workaround on the
loglevel global variable. The workaround existed to make sure that sysrq
header messages were sent to all consoles, but this doesn't work with
deferred messages because the loglevel might be restored to its original
value before a console flushes the messages.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20241105-printk-loud-con-v2-1-bd3ecdf7b0e4@suse.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
include/linux/printk.h
kernel/printk/internal.h
kernel/printk/printk.c
kernel/printk/printk_safe.c