aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/nmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/nmi.c')
-rw-r--r--arch/sparc/kernel/nmi.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/sparc/kernel/nmi.c b/arch/sparc/kernel/nmi.c
index f3577223c863..2c0cc72d295b 100644
--- a/arch/sparc/kernel/nmi.c
+++ b/arch/sparc/kernel/nmi.c
@@ -13,6 +13,7 @@
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/kprobes.h> 14#include <linux/kprobes.h>
15#include <linux/kernel_stat.h> 15#include <linux/kernel_stat.h>
16#include <linux/reboot.h>
16#include <linux/slab.h> 17#include <linux/slab.h>
17#include <linux/kdebug.h> 18#include <linux/kdebug.h>
18#include <linux/delay.h> 19#include <linux/delay.h>
@@ -206,13 +207,33 @@ void nmi_adjust_hz(unsigned int new_hz)
206} 207}
207EXPORT_SYMBOL_GPL(nmi_adjust_hz); 208EXPORT_SYMBOL_GPL(nmi_adjust_hz);
208 209
210static int nmi_shutdown(struct notifier_block *nb, unsigned long cmd, void *p)
211{
212 on_each_cpu(stop_watchdog, NULL, 1);
213 return 0;
214}
215
216static struct notifier_block nmi_reboot_notifier = {
217 .notifier_call = nmi_shutdown,
218};
219
209int __init nmi_init(void) 220int __init nmi_init(void)
210{ 221{
222 int err;
223
211 nmi_usable = 1; 224 nmi_usable = 1;
212 225
213 on_each_cpu(start_watchdog, NULL, 1); 226 on_each_cpu(start_watchdog, NULL, 1);
214 227
215 return check_nmi_watchdog(); 228 err = check_nmi_watchdog();
229 if (!err) {
230 err = register_reboot_notifier(&nmi_reboot_notifier);
231 if (err) {
232 nmi_usable = 0;
233 on_each_cpu(stop_watchdog, NULL, 1);
234 }
235 }
236 return err;
216} 237}
217 238
218static int __init setup_nmi_watchdog(char *str) 239static int __init setup_nmi_watchdog(char *str)