]> Git Repo - linux.git/commitdiff
watchdog: Add watchdog enable/disable all functions
authorStephane Eranian <[email protected]>
Mon, 17 Nov 2014 19:07:03 +0000 (20:07 +0100)
committerIngo Molnar <[email protected]>
Thu, 2 Apr 2015 15:33:15 +0000 (17:33 +0200)
This patch adds two new functions to enable/disable
the watchdog across all CPUs.

This will be used by the HT PMU bug workaround code to
disable/enable the NMI watchdog across quirk enablement.

Signed-off-by: Stephane Eranian <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Frederic Weisbecker <[email protected]>
Cc: Don Zickus <[email protected]>
Cc: Andrew Morton <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
include/linux/watchdog.h
kernel/watchdog.c

index 395b70e0eccf76e0cd31dc1e25afb5d3032fab50..a746bf5216f896c82e191b90078d7ffa92aaadf4 100644 (file)
@@ -137,4 +137,12 @@ extern int watchdog_init_timeout(struct watchdog_device *wdd,
 extern int watchdog_register_device(struct watchdog_device *);
 extern void watchdog_unregister_device(struct watchdog_device *);
 
+#ifdef CONFIG_HARDLOCKUP_DETECTOR
+void watchdog_nmi_disable_all(void);
+void watchdog_nmi_enable_all(void);
+#else
+static inline void watchdog_nmi_disable_all(void) {}
+static inline void watchdog_nmi_enable_all(void) {}
+#endif
+
 #endif  /* ifndef _LINUX_WATCHDOG_H */
index 3174bf8e353852ae886743b8ffbe33e46fb03c02..9a056f5bc02c8ed71a1ded6f925389f976241701 100644 (file)
@@ -567,9 +567,37 @@ static void watchdog_nmi_disable(unsigned int cpu)
                cpu0_err = 0;
        }
 }
+
+void watchdog_nmi_enable_all(void)
+{
+       int cpu;
+
+       if (!watchdog_user_enabled)
+               return;
+
+       get_online_cpus();
+       for_each_online_cpu(cpu)
+               watchdog_nmi_enable(cpu);
+       put_online_cpus();
+}
+
+void watchdog_nmi_disable_all(void)
+{
+       int cpu;
+
+       if (!watchdog_running)
+               return;
+
+       get_online_cpus();
+       for_each_online_cpu(cpu)
+               watchdog_nmi_disable(cpu);
+       put_online_cpus();
+}
 #else
 static int watchdog_nmi_enable(unsigned int cpu) { return 0; }
 static void watchdog_nmi_disable(unsigned int cpu) { return; }
+void watchdog_nmi_enable_all(void) {}
+void watchdog_nmi_disable_all(void) {}
 #endif /* CONFIG_HARDLOCKUP_DETECTOR */
 
 static struct smp_hotplug_thread watchdog_threads = {
This page took 0.048985 seconds and 4 git commands to generate.