diff options
-rw-r--r-- | arch/x86/kernel/nmi_32.c | 19 | ||||
-rw-r--r-- | include/asm-x86/nmi.h | 4 |
2 files changed, 14 insertions, 9 deletions
diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c index 4437fe1edabc..7714e8478213 100644 --- a/arch/x86/kernel/nmi_32.c +++ b/arch/x86/kernel/nmi_32.c | |||
@@ -51,6 +51,17 @@ static DEFINE_PER_CPU(short, wd_enabled); | |||
51 | 51 | ||
52 | static int endflag __initdata = 0; | 52 | static int endflag __initdata = 0; |
53 | 53 | ||
54 | /* Run after command line and cpu_init init, but before all other checks */ | ||
55 | void nmi_watchdog_default(void) | ||
56 | { | ||
57 | if (nmi_watchdog != NMI_DEFAULT) | ||
58 | return; | ||
59 | if (lapic_watchdog_ok()) | ||
60 | nmi_watchdog = NMI_LOCAL_APIC; | ||
61 | else | ||
62 | nmi_watchdog = NMI_IO_APIC; | ||
63 | } | ||
64 | |||
54 | #ifdef CONFIG_SMP | 65 | #ifdef CONFIG_SMP |
55 | /* The performance counters used by NMI_LOCAL_APIC don't trigger when | 66 | /* The performance counters used by NMI_LOCAL_APIC don't trigger when |
56 | * the CPU is idle. To make sure the NMI watchdog really ticks on all | 67 | * the CPU is idle. To make sure the NMI watchdog really ticks on all |
@@ -437,12 +448,8 @@ int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file, | |||
437 | return -EIO; | 448 | return -EIO; |
438 | } | 449 | } |
439 | 450 | ||
440 | if (nmi_watchdog == NMI_DEFAULT) { | 451 | /* if nmi_watchdog is not set yet, then set it */ |
441 | if (lapic_watchdog_ok()) | 452 | nmi_watchdog_default(); |
442 | nmi_watchdog = NMI_LOCAL_APIC; | ||
443 | else | ||
444 | nmi_watchdog = NMI_IO_APIC; | ||
445 | } | ||
446 | 453 | ||
447 | if (nmi_watchdog == NMI_LOCAL_APIC) { | 454 | if (nmi_watchdog == NMI_LOCAL_APIC) { |
448 | if (nmi_watchdog_enabled) | 455 | if (nmi_watchdog_enabled) |
diff --git a/include/asm-x86/nmi.h b/include/asm-x86/nmi.h index 7cd5b6a88138..1e8f34d7ab68 100644 --- a/include/asm-x86/nmi.h +++ b/include/asm-x86/nmi.h | |||
@@ -38,11 +38,9 @@ static inline void unset_nmi_pm_callback(struct pm_dev *dev) | |||
38 | 38 | ||
39 | #ifdef CONFIG_X86_64 | 39 | #ifdef CONFIG_X86_64 |
40 | extern void default_do_nmi(struct pt_regs *); | 40 | extern void default_do_nmi(struct pt_regs *); |
41 | extern void nmi_watchdog_default(void); | ||
42 | #else | ||
43 | #define nmi_watchdog_default() do {} while (0) | ||
44 | #endif | 41 | #endif |
45 | 42 | ||
43 | extern void nmi_watchdog_default(void); | ||
46 | extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); | 44 | extern void die_nmi(char *str, struct pt_regs *regs, int do_panic); |
47 | extern int check_nmi_watchdog(void); | 45 | extern int check_nmi_watchdog(void); |
48 | extern int nmi_watchdog_enabled; | 46 | extern int nmi_watchdog_enabled; |