diff options
-rw-r--r-- | include/linux/watchdog.h | 8 | ||||
-rw-r--r-- | kernel/watchdog.c | 28 |
2 files changed, 36 insertions, 0 deletions
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h index 395b70e0eccf..a746bf5216f8 100644 --- a/include/linux/watchdog.h +++ b/include/linux/watchdog.h | |||
@@ -137,4 +137,12 @@ extern int watchdog_init_timeout(struct watchdog_device *wdd, | |||
137 | extern int watchdog_register_device(struct watchdog_device *); | 137 | extern int watchdog_register_device(struct watchdog_device *); |
138 | extern void watchdog_unregister_device(struct watchdog_device *); | 138 | extern void watchdog_unregister_device(struct watchdog_device *); |
139 | 139 | ||
140 | #ifdef CONFIG_HARDLOCKUP_DETECTOR | ||
141 | void watchdog_nmi_disable_all(void); | ||
142 | void watchdog_nmi_enable_all(void); | ||
143 | #else | ||
144 | static inline void watchdog_nmi_disable_all(void) {} | ||
145 | static inline void watchdog_nmi_enable_all(void) {} | ||
146 | #endif | ||
147 | |||
140 | #endif /* ifndef _LINUX_WATCHDOG_H */ | 148 | #endif /* ifndef _LINUX_WATCHDOG_H */ |
diff --git a/kernel/watchdog.c b/kernel/watchdog.c index 3174bf8e3538..9a056f5bc02c 100644 --- a/kernel/watchdog.c +++ b/kernel/watchdog.c | |||
@@ -567,9 +567,37 @@ static void watchdog_nmi_disable(unsigned int cpu) | |||
567 | cpu0_err = 0; | 567 | cpu0_err = 0; |
568 | } | 568 | } |
569 | } | 569 | } |
570 | |||
571 | void watchdog_nmi_enable_all(void) | ||
572 | { | ||
573 | int cpu; | ||
574 | |||
575 | if (!watchdog_user_enabled) | ||
576 | return; | ||
577 | |||
578 | get_online_cpus(); | ||
579 | for_each_online_cpu(cpu) | ||
580 | watchdog_nmi_enable(cpu); | ||
581 | put_online_cpus(); | ||
582 | } | ||
583 | |||
584 | void watchdog_nmi_disable_all(void) | ||
585 | { | ||
586 | int cpu; | ||
587 | |||
588 | if (!watchdog_running) | ||
589 | return; | ||
590 | |||
591 | get_online_cpus(); | ||
592 | for_each_online_cpu(cpu) | ||
593 | watchdog_nmi_disable(cpu); | ||
594 | put_online_cpus(); | ||
595 | } | ||
570 | #else | 596 | #else |
571 | static int watchdog_nmi_enable(unsigned int cpu) { return 0; } | 597 | static int watchdog_nmi_enable(unsigned int cpu) { return 0; } |
572 | static void watchdog_nmi_disable(unsigned int cpu) { return; } | 598 | static void watchdog_nmi_disable(unsigned int cpu) { return; } |
599 | void watchdog_nmi_enable_all(void) {} | ||
600 | void watchdog_nmi_disable_all(void) {} | ||
573 | #endif /* CONFIG_HARDLOCKUP_DETECTOR */ | 601 | #endif /* CONFIG_HARDLOCKUP_DETECTOR */ |
574 | 602 | ||
575 | static struct smp_hotplug_thread watchdog_threads = { | 603 | static struct smp_hotplug_thread watchdog_threads = { |