summaryrefslogtreecommitdiff
path: root/kernel/printk/printk.c
diff options
context:
space:
mode:
authorPetr Mladek <pmladek@suse.com>2025-01-20 13:40:52 +0100
committerPetr Mladek <pmladek@suse.com>2025-01-20 13:40:52 +0100
commit4859bcd7a5bb2fda9660cb48ab41d9c5e4e1a6ec (patch)
treeb166ae154c8d853df917d26580f7732a813fabcd /kernel/printk/printk.c
parent3d6f83df8ff2d5de84b50377e4f0d45e25311c7a (diff)
parent0161e2d6950fe66cf6ac1c10d945bae971f33667 (diff)
Merge branch 'for-6.14-cpu_sync-fixup' into for-linus
Diffstat (limited to 'kernel/printk/printk.c')
-rw-r--r--kernel/printk/printk.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index d8d82dd39dee..07668433644b 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -4922,6 +4922,11 @@ void console_try_replay_all(void)
static atomic_t printk_cpu_sync_owner = ATOMIC_INIT(-1);
static atomic_t printk_cpu_sync_nested = ATOMIC_INIT(0);
+bool is_printk_cpu_sync_owner(void)
+{
+ return (atomic_read(&printk_cpu_sync_owner) == raw_smp_processor_id());
+}
+
/**
* __printk_cpu_sync_wait() - Busy wait until the printk cpu-reentrant
* spinning lock is not owned by any CPU.