浏览代码

i386: fix a hang on stuck nmi watchdog

In the case when an nmi gets stucks the endflag stays equal to zero.
This causes the busy looping on other cpus to continue, even though the
nmi test is done.

On my machine with out the change below the system would hang right
after check_nmi_watchdog().  The change below just sets endflag prior to
checking if the test was successful or not.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Daniel Walker 18 年之前
父节点
当前提交
d95865480d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      arch/i386/kernel/nmi.c

+ 1 - 1
arch/i386/kernel/nmi.c

@@ -115,12 +115,12 @@ static int __init check_nmi_watchdog(void)
 			atomic_dec(&nmi_active);
 			atomic_dec(&nmi_active);
 		}
 		}
 	}
 	}
+	endflag = 1;
 	if (!atomic_read(&nmi_active)) {
 	if (!atomic_read(&nmi_active)) {
 		kfree(prev_nmi_count);
 		kfree(prev_nmi_count);
 		atomic_set(&nmi_active, -1);
 		atomic_set(&nmi_active, -1);
 		return -1;
 		return -1;
 	}
 	}
-	endflag = 1;
 	printk("OK.\n");
 	printk("OK.\n");
 
 
 	/* now that we know it works we can reduce NMI frequency to
 	/* now that we know it works we can reduce NMI frequency to