Commit b884e257 authored by GOTO Masanori's avatar GOTO Masanori Committed by Linus Torvalds

[PATCH] x86: Fix i386 nmi_watchdog that does not trigger die_nmi

Fix i386 nmi_watchdog that does not meet watchdog timeout condition.  It
does not hit die_nmi when it should be triggered, because the current
nmi_watchdog_tick in arch/i386/kernel/nmi.c never count up alert_counter
like this:

	void nmi_watchdog_tick (struct pt_regs * regs) {
	if (last_irq_sums[cpu] == sum) {
		alert_counter[cpu]++;		<- count up alert_counter, but
		if (alert_counter[cpu] == 5*nmi_hz)
			die_nmi(regs, "NMI Watchdog detected LOCKUP");
		alert_counter[cpu] = 0;		<- reset alert_counter

This patch changes it back to the previous and working version.

This was found and originally written by Kohta NAKASHIMA.

(akpm: also uninline write_watchdog_counter(), saving 184 byets)
Signed-off-by: default avatarGOTO Masanori <gotom@sanori.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 707ced0d
...@@ -357,7 +357,7 @@ static void clear_msr_range(unsigned int base, unsigned int n) ...@@ -357,7 +357,7 @@ static void clear_msr_range(unsigned int base, unsigned int n)
wrmsr(base+i, 0, 0); wrmsr(base+i, 0, 0);
} }
static inline void write_watchdog_counter(const char *descr) static void write_watchdog_counter(const char *descr)
{ {
u64 count = (u64)cpu_khz * 1000; u64 count = (u64)cpu_khz * 1000;
...@@ -544,7 +544,7 @@ void nmi_watchdog_tick (struct pt_regs * regs) ...@@ -544,7 +544,7 @@ void nmi_watchdog_tick (struct pt_regs * regs)
* die_nmi will return ONLY if NOTIFY_STOP happens.. * die_nmi will return ONLY if NOTIFY_STOP happens..
*/ */
die_nmi(regs, "NMI Watchdog detected LOCKUP"); die_nmi(regs, "NMI Watchdog detected LOCKUP");
} else {
last_irq_sums[cpu] = sum; last_irq_sums[cpu] = sum;
alert_counter[cpu] = 0; alert_counter[cpu] = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment