diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-07-22 15:58:40 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-10 00:18:47 (GMT) |
commit | 765986731ec002f5608d3bd3d4a093b645fb40ed (patch) | |
tree | 85466fc349252d0cc6d9e9ded25b29d9e21919ee /kernel/watchdog.c | |
parent | 017907f4541930de79139fbcbcd2c4b0bbea4e10 (diff) | |
download | linux-fsl-qoriq-765986731ec002f5608d3bd3d4a093b645fb40ed.tar.xz |
printk-kill.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/watchdog.c')
-rw-r--r-- | kernel/watchdog.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 4431610..cbad091 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c @@ -205,6 +205,8 @@ static int is_softlockup(unsigned long touch_ts) #ifdef CONFIG_HARDLOCKUP_DETECTOR +static DEFINE_RAW_SPINLOCK(watchdog_output_lock); + static struct perf_event_attr wd_hw_attr = { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES, @@ -239,10 +241,19 @@ static void watchdog_overflow_callback(struct perf_event *event, if (__this_cpu_read(hard_watchdog_warn) == true) return; - if (hardlockup_panic) + /* + * If early-printk is enabled then make sure we do not + * lock up in printk() and kill console logging: + */ + printk_kill(); + + if (hardlockup_panic) { panic("Watchdog detected hard LOCKUP on cpu %d", this_cpu); - else + } else { + raw_spin_lock(&watchdog_output_lock); WARN(1, "Watchdog detected hard LOCKUP on cpu %d", this_cpu); + raw_spin_unlock(&watchdog_output_lock); + } __this_cpu_write(hard_watchdog_warn, true); return; |