printk: rename cpulock functions
authorJohn Ogness <john.ogness@linutronix.de>
Thu, 21 Apr 2022 21:22:36 +0000 (23:28 +0206)
committerPetr Mladek <pmladek@suse.com>
Fri, 22 Apr 2022 19:30:57 +0000 (21:30 +0200)
commitfaebd693c59387b7b765fab64b543855e15a91b4
treedc9488b74668e7602f114e5ccf759d6d924e1d3f
parent3ef4ea3d84ca568dcd57816b9521e82e3bd94f08
printk: rename cpulock functions

Since the printk cpulock is CPU-reentrant and since it is used
in all contexts, its usage must be carefully considered and
most likely will require programming locklessly. To avoid
mistaking the printk cpulock as a typical lock, rename it to
cpu_sync. The main functions then become:

    printk_cpu_sync_get_irqsave(flags);
    printk_cpu_sync_put_irqrestore(flags);

Add extra notes of caution in the function description to help
developers understand the requirements for correct usage.

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/20220421212250.565456-2-john.ogness@linutronix.de
include/linux/printk.h
kernel/printk/printk.c
lib/dump_stack.c
lib/nmi_backtrace.c