diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index 970296f4403b31cc22c6b52472917e73cbd2462a..c5470431a1b63ada9638924bc1108f529493d62a 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c @@ -924,6 +924,7 @@ void nmi_shootdown_cpus(nmi_shootdown_cb callback) mdelay(1); msecs--; } + zap_locks(); /* * Leave the nmi callback set, shootdown is a one-time thing. Clearing diff --git a/kernel/printk/printk_safe.c b/kernel/printk/printk_safe.c index b774685ccf8089df7a22261795d9dd70738b72da..4ee5e1b4cea0b5bacf0b7f3e1f64811a1af92282 100644 --- a/kernel/printk/printk_safe.c +++ b/kernel/printk/printk_safe.c @@ -246,6 +246,10 @@ void printk_safe_flush(void) { int cpu; + if (raw_spin_is_locked(&logbuf_lock) && + (this_cpu_read(printk_context) & PRINTK_SAFE_CONTEXT_MASK)) + return; + for_each_possible_cpu(cpu) { #ifdef CONFIG_PRINTK_NMI __printk_safe_flush(&per_cpu(nmi_print_seq, cpu).work);