linux/kernel/printk
John Ogness a63a05db13 dump_stack: Do not get cpu_sync for panic CPU
[ Upstream commit 7412dc6d55 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-13 13:09:58 +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-04-13 13:09:58 +02:00
Makefile printk: Add non-BKL (nbcon) console basic infrastructure 2023-09-18 17:03:45 +02:00
nbcon.c printk: nbcon: Relocate 32bit seq macros 2024-03-26 18:16:40 -04:00
printk_ringbuffer.c printk: Use prb_first_seq() as base for 32bit seq macros 2024-03-26 18:17:39 -04:00
printk_ringbuffer.h printk: Use prb_first_seq() as base for 32bit seq macros 2024-03-26 18:17:39 -04:00
printk_safe.c printk: Consolidate console deferred printing 2023-07-20 13:06:22 +02:00
printk.c printk: For @suppress_panic_printk check for other CPU in panic 2024-04-13 13:09:58 +02:00
sysctl.c printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin() 2022-02-03 11:27:38 -08:00