printk: console_device: use srcu console list iterator
authorJohn Ogness <john.ogness@linutronix.de>
Wed, 16 Nov 2022 16:21:32 +0000 (17:27 +0106)
committerPetr Mladek <pmladek@suse.com>
Fri, 2 Dec 2022 10:25:01 +0000 (11:25 +0100)
commit8cb15f7f492f85d695a6f4d12044c47230f69d96
tree41f575078a02039fea2204821414562413dd71b4
parent87f2e4b7d9e5c50756184b4f8d0b92680de61496
printk: console_device: use srcu console list iterator

Use srcu console list iteration for console list traversal. It is
acceptable because the consoles might come and go at any time.
Strict synchronizing with console registration code would not bring
any advantage over srcu.

Document why the console_lock is still necessary. Note that this
is a preparatory change for when console_lock no longer provides
synchronization for the console list.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20221116162152.193147-21-john.ogness@linutronix.de
kernel/printk/printk.c