summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/nmi_32.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2008-05-24 19:36:35 +0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-25 22:32:51 +0200
commit4b82b277707a39b97271439c475f186f63ec4692 (patch)
treedef1609a31a1ee3eef6bd2b22a9056bf7d513050 /arch/x86/kernel/nmi_32.c
parentd1b946b97d71423f365fa797d1428e1847c0bec1 (diff)
downloadop-kernel-dev-4b82b277707a39b97271439c475f186f63ec4692.zip
op-kernel-dev-4b82b277707a39b97271439c475f186f63ec4692.tar.gz
x86: nmi_32.c - add nmi_watchdog_default helper
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Cc: hpa@zytor.com Cc: mingo@redhat.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/nmi_32.c')
-rw-r--r--arch/x86/kernel/nmi_32.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/x86/kernel/nmi_32.c b/arch/x86/kernel/nmi_32.c
index 4437fe1..7714e84 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);
static int endflag __initdata = 0;
+/* Run after command line and cpu_init init, but before all other checks */
+void nmi_watchdog_default(void)
+{
+ if (nmi_watchdog != NMI_DEFAULT)
+ return;
+ if (lapic_watchdog_ok())
+ nmi_watchdog = NMI_LOCAL_APIC;
+ else
+ nmi_watchdog = NMI_IO_APIC;
+}
+
#ifdef CONFIG_SMP
/* The performance counters used by NMI_LOCAL_APIC don't trigger when
* 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,
return -EIO;
}
- if (nmi_watchdog == NMI_DEFAULT) {
- if (lapic_watchdog_ok())
- nmi_watchdog = NMI_LOCAL_APIC;
- else
- nmi_watchdog = NMI_IO_APIC;
- }
+ /* if nmi_watchdog is not set yet, then set it */
+ nmi_watchdog_default();
if (nmi_watchdog == NMI_LOCAL_APIC) {
if (nmi_watchdog_enabled)
OpenPOWER on IntegriCloud