diff --git a/include/linux/printk.h b/include/linux/printk.h index de1457e3af3f2b7d2b7f041d6c0aee718c1ecf42..e6a8ee6db68e314a42affb64c3897f173d062a8f 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -209,8 +209,12 @@ void show_regs_print_info(const char *log_lvl); extern asmlinkage void dump_stack(void) __cold; extern void printk_safe_flush(void); extern void printk_safe_flush_on_panic(void); +#if defined(CONFIG_X86) || defined(CONFIG_ARM64_PSEUDO_NMI) extern void zap_locks(void); #else +static inline void zap_locks(void) { } +#endif +#else static inline __printf(1, 0) int vprintk(const char *s, va_list args) { diff --git a/kernel/panic.c b/kernel/panic.c index 3d75855db4e6176be241418bf1e35c2d8206e9b4..d991c3b1b5591dd2aaa933a727cc91e9bee4644b 100644 --- a/kernel/panic.c +++ b/kernel/panic.c @@ -265,6 +265,7 @@ void panic(const char *fmt, ...) crash_smp_send_stop(); } +#if defined(CONFIG_X86) || defined(CONFIG_ARM64_PSEUDO_NMI) /* * ZAP console related locks when nmi broadcast. If a crash is occurring, * make sure we can't deadlock. And make sure that we print immediately. @@ -288,7 +289,6 @@ void panic(const char *fmt, ...) * have a chance to see the messages. Others prefer to always * reach emergency_restart() and reboot the machine. */ -#ifdef CONFIG_X86 zap_locks(); #endif diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 69a1be81dd98b7c888db7fe1fc1e2ce61510ba88..729e4ce2decbd168eb86000130be4f44bdcebfbe 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -1742,6 +1742,7 @@ static DEFINE_RAW_SPINLOCK(console_owner_lock); static struct task_struct *console_owner; static bool console_waiter; +#if defined(CONFIG_X86) || defined(CONFIG_ARM64_PSEUDO_NMI) void zap_locks(void) { if (raw_spin_is_locked(&logbuf_lock)) { @@ -1758,6 +1759,7 @@ void zap_locks(void) sema_init(&console_sem, 1); } +#endif /** * console_lock_spinning_enable - mark beginning of code where another