linux-stable/kernel/printk
John Ogness 7412dc6d55 dump_stack: Do not get cpu_sync for panic CPU
dump_stack() is called in panic(). If for some reason another CPU
is holding the printk_cpu_sync and is unable to release it, the
panic CPU will be unable to continue and print the stacktrace.

Since non-panic CPUs are not allowed to store new printk messages
anyway, there is no need to synchronize the stacktrace output in
a panic situation.

For the panic CPU, do not get the printk_cpu_sync because it is
not needed and avoids a potential deadlock scenario in panic().

Link: https://lore.kernel.org/lkml/ZcIGKU8sxti38Kok@alley
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240207134103.1357162-15-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
2024-02-07 17:23:19 +01:00
..
Makefile printk: Add non-BKL (nbcon) console basic infrastructure 2023-09-18 17:03:45 +02:00
braille.c printk: Replace strncmp() with str_has_prefix() 2019-08-16 09:54:08 +02:00
braille.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
console_cmdline.h printk: Fix preferred console selection with multiple matches 2020-02-18 09:34:42 +01:00
index.c kernel/printk/index.c: fix memory leak with using debugfs_lookup() 2023-02-03 10:42:02 +01:00
internal.h dump_stack: Do not get cpu_sync for panic CPU 2024-02-07 17:23:19 +01:00
nbcon.c printk: nbcon: Relocate 32bit seq macros 2024-02-07 17:23:17 +01:00
printk.c printk: Avoid non-panic CPUs writing to ringbuffer 2024-02-07 17:23:19 +01:00
printk_ringbuffer.c printk: ringbuffer: Skip non-finalized records in panic 2024-02-07 17:23:18 +01:00
printk_ringbuffer.h printk: Wait for all reserved records with pr_flush() 2024-02-07 17:23:18 +01:00
printk_safe.c printk: Consolidate console deferred printing 2023-07-20 13:06:22 +02:00
sysctl.c printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin() 2022-02-03 11:27:38 -08:00