aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHillf Danton <dhillf@gmail.com>2011-04-27 18:26:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-28 14:28:21 -0400
commit1409f141ac719b994d2832911b1e9ec928943fc2 (patch)
tree2ef8c9431f15cae6f243482cbe1cf9f11ae60082
parent534e3adbd22efa327e6ff27cf2d8ebaad8382ecd (diff)
kernel/watchdog.c: disable nmi perf event in the error path of enabling watchdog
In corner cases where softlockup watchdog is not setup successfully, the relevant nmi perf event for hardlockup watchdog could be disabled, then the status of the underlying hardware remains unchanged. Also, if the kthread doesn't start then the hrtimer won't run and the hardlockup detector will falsely fire. Signed-off-by: Hillf Danton <dhillf@gmail.com> Signed-off-by: Don Zickus <dzickus@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/watchdog.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 140dce75045..14733d4d156 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -430,9 +430,12 @@ static int watchdog_enable(int cpu)
430 p = kthread_create(watchdog, (void *)(unsigned long)cpu, "watchdog/%d", cpu); 430 p = kthread_create(watchdog, (void *)(unsigned long)cpu, "watchdog/%d", cpu);
431 if (IS_ERR(p)) { 431 if (IS_ERR(p)) {
432 printk(KERN_ERR "softlockup watchdog for %i failed\n", cpu); 432 printk(KERN_ERR "softlockup watchdog for %i failed\n", cpu);
433 if (!err) 433 if (!err) {
434 /* if hardlockup hasn't already set this */ 434 /* if hardlockup hasn't already set this */
435 err = PTR_ERR(p); 435 err = PTR_ERR(p);
436 /* and disable the perf event */
437 watchdog_nmi_disable(cpu);
438 }
436 goto out; 439 goto out;
437 } 440 }
438 kthread_bind(p, cpu); 441 kthread_bind(p, cpu);