printk: nbcon: Allow drivers to mark unsafe regions and check state
authorThomas Gleixner <tglx@linutronix.de>
Sat, 16 Sep 2023 19:20:07 +0000 (21:26 +0206)
committerPetr Mladek <pmladek@suse.com>
Mon, 18 Sep 2023 15:03:46 +0000 (17:03 +0200)
commit9757acd0a700ba4a0d16dde4ba820eb052aba1a7
tree159b85fae4ed9c4cd1c7e0774229fde8c86f9ada
parent06653d57ff283be627a2c769139d73ecc487810f
printk: nbcon: Allow drivers to mark unsafe regions and check state

For the write_atomic callback, the console driver may have unsafe
regions that need to be appropriately marked. Provide functions
that accept the nbcon_write_context struct to allow for the driver
to enter and exit unsafe regions.

Also provide a function for drivers to check if they are still the
owner of the console.

Co-developed-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Thomas Gleixner (Intel) <tglx@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20230916192007.608398-9-john.ogness@linutronix.de
include/linux/console.h
kernel/printk/nbcon.c