Skip to content

Commit 7d5775d

Browse files
committed
Merge tag 'printk-for-5.16-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux
Pull printk fixes from Petr Mladek: - Try to flush backtraces from other CPUs also on the local one. This was a regression caused by printk_safe buffers removal. - Remove header dependency warning. * tag 'printk-for-5.16-fixup' of git://git.kernel.org/pub/scm/linux/kernel/git/printk/linux: printk: Remove printk.h inclusion in percpu.h printk: restore flushing of NMI buffers on remote CPUs after NMI backtraces
2 parents 42eb8fd + bf6d0d1 commit 7d5775d

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

arch/powerpc/kernel/watchdog.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@ static void watchdog_smp_panic(int cpu, u64 tb)
187187
if (sysctl_hardlockup_all_cpu_backtrace)
188188
trigger_allbutself_cpu_backtrace();
189189

190+
/*
191+
* Force flush any remote buffers that might be stuck in IRQ context
192+
* and therefore could not run their irq_work.
193+
*/
194+
printk_trigger_flush();
195+
190196
if (hardlockup_panic)
191197
nmi_panic(NULL, "Hard LOCKUP");
192198

include/linux/percpu.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
#include <linux/preempt.h>
77
#include <linux/smp.h>
88
#include <linux/cpumask.h>
9-
#include <linux/printk.h>
109
#include <linux/pfn.h>
1110
#include <linux/init.h>
1211

include/linux/printk.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ void dump_stack_print_info(const char *log_lvl);
198198
void show_regs_print_info(const char *log_lvl);
199199
extern asmlinkage void dump_stack_lvl(const char *log_lvl) __cold;
200200
extern asmlinkage void dump_stack(void) __cold;
201+
void printk_trigger_flush(void);
201202
#else
202203
static inline __printf(1, 0)
203204
int vprintk(const char *s, va_list args)
@@ -274,6 +275,9 @@ static inline void dump_stack_lvl(const char *log_lvl)
274275
static inline void dump_stack(void)
275276
{
276277
}
278+
static inline void printk_trigger_flush(void)
279+
{
280+
}
277281
#endif
278282

279283
#ifdef CONFIG_SMP

kernel/printk/printk.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3253,6 +3253,11 @@ void defer_console_output(void)
32533253
preempt_enable();
32543254
}
32553255

3256+
void printk_trigger_flush(void)
3257+
{
3258+
defer_console_output();
3259+
}
3260+
32563261
int vprintk_deferred(const char *fmt, va_list args)
32573262
{
32583263
int r;

lib/nmi_backtrace.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ void nmi_trigger_cpumask_backtrace(const cpumask_t *mask,
7575
touch_softlockup_watchdog();
7676
}
7777

78+
/*
79+
* Force flush any remote buffers that might be stuck in IRQ context
80+
* and therefore could not run their irq_work.
81+
*/
82+
printk_trigger_flush();
83+
7884
clear_bit_unlock(0, &backtrace_flag);
7985
put_cpu();
8086
}

0 commit comments

Comments
 (0)