diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-06-24 16:52:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-08 06:51:41 -0400 |
commit | c376d45432d935e6f1e0ff2d6be3734bcd3ba455 (patch) | |
tree | c776405c9734a11e6947b55cd2c44e4d7ec1fcfb /arch/x86/kernel/nmi.c | |
parent | 2b6addad2d67a2d75ae10a1c8efd18d81d78ff82 (diff) |
x86: nmi_watchdog - use NMI_NONE by default
There is no need to keep NMI_DISABLED definition and use it
for nmi_watchdog by default. Here is the point why:
- IO-APIC and APIC chips are programmed for nmi_watchdog support at very
early stage of kernel booting and not having nmi_watchdog specified as
boot option lead only to nmi_watchdog becomes to NMI_NONE anyway
- enable nmi_watchdog thru /proc/sys/kernel/nmi if it was not specified at
boot is not possible too (even having this sysfs entry)
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: macro@linux-mips.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/nmi.c')
-rw-r--r-- | arch/x86/kernel/nmi.c | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c index 427c511e7adc..32acda25e3cb 100644 --- a/arch/x86/kernel/nmi.c +++ b/arch/x86/kernel/nmi.c | |||
@@ -52,7 +52,7 @@ static cpumask_t backtrace_mask = CPU_MASK_NONE; | |||
52 | atomic_t nmi_active = ATOMIC_INIT(0); /* oprofile uses this */ | 52 | atomic_t nmi_active = ATOMIC_INIT(0); /* oprofile uses this */ |
53 | EXPORT_SYMBOL(nmi_active); | 53 | EXPORT_SYMBOL(nmi_active); |
54 | 54 | ||
55 | unsigned int nmi_watchdog = NMI_DEFAULT; | 55 | unsigned int nmi_watchdog = NMI_NONE; |
56 | EXPORT_SYMBOL(nmi_watchdog); | 56 | EXPORT_SYMBOL(nmi_watchdog); |
57 | 57 | ||
58 | static int panic_on_timeout; | 58 | static int panic_on_timeout; |
@@ -92,14 +92,6 @@ static inline unsigned int get_timer_irqs(int cpu) | |||
92 | #endif | 92 | #endif |
93 | } | 93 | } |
94 | 94 | ||
95 | /* Run after command line and cpu_init init, but before all other checks */ | ||
96 | void nmi_watchdog_default(void) | ||
97 | { | ||
98 | if (nmi_watchdog != NMI_DEFAULT) | ||
99 | return; | ||
100 | nmi_watchdog = NMI_NONE; | ||
101 | } | ||
102 | |||
103 | #ifdef CONFIG_SMP | 95 | #ifdef CONFIG_SMP |
104 | /* | 96 | /* |
105 | * The performance counters used by NMI_LOCAL_APIC don't trigger when | 97 | * The performance counters used by NMI_LOCAL_APIC don't trigger when |
@@ -127,7 +119,7 @@ int __init check_nmi_watchdog(void) | |||
127 | unsigned int *prev_nmi_count; | 119 | unsigned int *prev_nmi_count; |
128 | int cpu; | 120 | int cpu; |
129 | 121 | ||
130 | if (nmi_watchdog == NMI_NONE || nmi_watchdog == NMI_DISABLED) | 122 | if (nmi_watchdog == NMI_NONE) |
131 | return 0; | 123 | return 0; |
132 | 124 | ||
133 | if (!atomic_read(&nmi_active)) | 125 | if (!atomic_read(&nmi_active)) |
@@ -482,24 +474,12 @@ int proc_nmi_enabled(struct ctl_table *table, int write, struct file *file, | |||
482 | if (!!old_state == !!nmi_watchdog_enabled) | 474 | if (!!old_state == !!nmi_watchdog_enabled) |
483 | return 0; | 475 | return 0; |
484 | 476 | ||
485 | if (atomic_read(&nmi_active) < 0 || nmi_watchdog == NMI_DISABLED) { | 477 | if (atomic_read(&nmi_active) < 0 || nmi_watchdog == NMI_NONE) { |
486 | printk(KERN_WARNING | 478 | printk(KERN_WARNING |
487 | "NMI watchdog is permanently disabled\n"); | 479 | "NMI watchdog is permanently disabled\n"); |
488 | return -EIO; | 480 | return -EIO; |
489 | } | 481 | } |
490 | 482 | ||
491 | /* if nmi_watchdog is not set yet, then set it */ | ||
492 | nmi_watchdog_default(); | ||
493 | |||
494 | #ifdef CONFIG_X86_32 | ||
495 | if (nmi_watchdog == NMI_NONE) { | ||
496 | if (lapic_watchdog_ok()) | ||
497 | nmi_watchdog = NMI_LOCAL_APIC; | ||
498 | else | ||
499 | nmi_watchdog = NMI_IO_APIC; | ||
500 | } | ||
501 | #endif | ||
502 | |||
503 | if (nmi_watchdog == NMI_LOCAL_APIC) { | 483 | if (nmi_watchdog == NMI_LOCAL_APIC) { |
504 | if (nmi_watchdog_enabled) | 484 | if (nmi_watchdog_enabled) |
505 | enable_lapic_nmi_watchdog(); | 485 | enable_lapic_nmi_watchdog(); |