Skip to content
Commit 0161e2d6 authored by John Ogness's avatar John Ogness Committed by Petr Mladek
Browse files

printk: Defer legacy printing when holding printk_cpu_sync



The documentation of printk_cpu_sync_get() clearly states
that the owner must never perform any activities where it waits
for a CPU. For legacy printing there can be spinning on the
console_lock and on the port lock. Therefore legacy printing
must be deferred when holding the printk_cpu_sync.

Note that in the case of emergency states, atomic consoles
are not prevented from printing when printk is deferred. This
is appropriate because they do not spin-wait indefinitely for
other CPUs.

Reported-by: default avatarRik van Riel <riel@surriel.com>
Closes: https://lore.kernel.org/r/20240715232052.73eb7fb1@imladris.surriel.com


Signed-off-by: default avatarJohn Ogness <john.ogness@linutronix.de>
Fixes: 55d6af1d ("lib/nmi_backtrace: explicitly serialize banner and regs")
Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20241209111746.192559-3-john.ogness@linutronix.de


Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
parent f1c21cf4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment