13 #include <linux/bitops.h>
22 #include <asm/cacheflush.h>
25 #define DRV_NAME "nmi-wdt"
27 #define NMI_WDT_TIMEOUT 5
28 #define NMI_CHECK_TIMEOUT (4 * HZ)
29 static int nmi_wdt_cpu = 1;
32 static int nmi_active;
34 static unsigned short wdoga_ctl;
35 static unsigned int wdoga_cnt;
47 static unsigned long nmi_event
__attribute__ ((__section__(
".l2.bss")));
50 static inline void set_nmi_event(
int event)
55 static inline void wait_nmi_event(
int event)
62 static inline void send_corea_nmi(
void)
72 static inline void restore_corea_nmi(
void)
81 static inline void save_corelock(
void)
87 static inline void restore_corelock(
void)
93 static inline void nmi_wdt_keepalive(
void)
98 static inline void nmi_wdt_stop(
void)
104 static inline void nmi_wdt_clear(
void)
110 static inline void nmi_wdt_start(
void)
115 static inline int nmi_wdt_running(
void)
120 static inline int nmi_wdt_set_timeout(
unsigned long t)
129 pr_warning(
"NMI: timeout value is too large\n");
133 run = nmi_wdt_running();
156 cpumask_clear_cpu(this_cpu, &mask);
159 (
unsigned long)(&nmi_touched[cpu]));
168 static void nmi_wdt_timer(
unsigned long data)
176 static int __init init_nmi_wdt(
void)
178 nmi_wdt_set_timeout(timeout);
183 ntimer.function = nmi_wdt_timer;
187 pr_info(
"nmi_wdt: initialized: timeout=%d sec\n", timeout);
199 static int nmi_wdt_suspend(
void)
205 static void nmi_wdt_resume(
void)
213 .suspend = nmi_wdt_suspend,
216 static int __init init_nmi_wdt_syscore(
void)
235 if (cpu == nmi_wdt_cpu) {
264 pr_emerg(
"\nNMI Watchdog detected LOCKUP, dump for CPU %d\n", cpu);
271 if (cpu == nmi_wdt_cpu) {
272 pr_emerg(
"This fault is not recoverable, sorry!\n");