printk: Prepare for SRCU console list protection
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 16 Nov 2022 16:21:15 +0000 (17:27 +0106)
committerPetr Mladek <pmladek@suse.com>
Fri, 2 Dec 2022 10:24:59 +0000 (11:24 +0100)
commit6c4afa79147e4aa86665795695ac4a5f25e73176
tree303743239f481d5eeb6ae90f33ec164de2e48a3a
parentd9a4af5690e26afa8a2eb83c575d3a9ef52cde1d
printk: Prepare for SRCU console list protection

Provide an NMI-safe SRCU protected variant to walk the console list.

Note that all console fields are now set before adding the console
to the list to avoid the console becoming visible by SCRU readers
before being fully initialized.

This is a preparatory change for a new console infrastructure which
operates independent of the console BKL.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Reviewed-by: Paul E. McKenney <paulmck@kernel.org>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20221116162152.193147-4-john.ogness@linutronix.de
.clang-format
include/linux/console.h
kernel/printk/printk.c