Skip to contentSkip to conversation

watchdog: Disable nmi perf event in the error path of enabling watchdog

PATCH New Don Zickus 1 participant 1 message Apr 21, 2011

lore
Share & tools
lore

Don Zickus

author
#0 lore raw

PATCH 1/1 watchdog: Disable nmi perf event in the error path of enabling watchdog

From: Hillf Danton <[email protected]>

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, the hrtimer won't run and the
hardlockup detector will falsely fire ]

---
 kernel/watchdog.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
kernel/watchdog.c +4 -1
index 140dce7..14733d4 100644
@@ -430,9 +430,12 @@ static int watchdog_enable(int cpu)
 		p = kthread_create(watchdog, (void *)(unsigned long)cpu, "watchdog/%d", cpu);
 		if (IS_ERR(p)) {
 			printk(KERN_ERR "softlockup watchdog for %i failed\n", cpu);
-			if (!err)
+			if (!err) {
 				/* if hardlockup hasn't already set this */
 				err = PTR_ERR(p);
+				/* and disable the perf event */
+				watchdog_nmi_disable(cpu);
+			}
 			goto out;
 		}
 		kthread_bind(p, cpu);
Signature · 1 line
1.7.4.2