Patchwork [tip:core/urgent] watchdog: Fix CPU hotplug regression

mail settings
Submitter Thomas Gleixner
Date Dec. 4, 2012, 7:10 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/1839361/
State New, archived
Headers show


Thomas Gleixner - Dec. 4, 2012, 7:10 p.m.
Commit-ID:  8d4516904b39507458bee8115793528e12b1d8dd
Author:     Thomas Gleixner <>
AuthorDate: Tue, 4 Dec 2012 18:59:34 +0100
Committer:  Thomas Gleixner <>
CommitDate: Tue, 4 Dec 2012 19:56:59 +0100

watchdog: Fix CPU hotplug regression

Norbert reported:
"3.7-rc6 booted with nmi_watchdog=0 fails to suspend to RAM or
 offline CPUs. It's reproducable with a KVM guest and physical

The reason is that commit bcd951cf(watchdog: Use hotplug thread
infrastructure) missed to take this into account. So the cpu offline
code gets stuck in the teardown function because it accesses non
initialized data structures.

Add a check for watchdog_enabled into that path to cure the issue.

Reported-and-tested-by: Norbert Warmuth <>
Tested-by: Joseph Salisbury <>
Signed-off-by: Thomas Gleixner <>
 kernel/watchdog.c | 3 +++
 1 file changed, 3 insertions(+)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at


diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index dd4b80a..c8c21be 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -368,6 +368,9 @@  static void watchdog_disable(unsigned int cpu)
 	struct hrtimer *hrtimer = &__raw_get_cpu_var(watchdog_hrtimer);
+	if (!watchdog_enabled)
+		return;
 	watchdog_set_prio(SCHED_NORMAL, 0);
 	/* disable the perf event */