Commit 01d5c986 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Oprofile: fix nmi_timer_int detection

From: Philippe Elie <phil.el@wanadoo.fr>

From: Zwane Mwaikambo <zwane@arm.linux.org.uk>

The nmi_timer_int oprofile driver was enabling itself unconditionally if an
SMP kernel was being used on a UP system without an IOAPIC.

Tested on a P5 using NMI timer int driver and UP system using timer int
driver both running an SMP kernel.

2004-02-11  Zwane Mwaikambo <zwane@arm.linux.org.uk>

	* arch/i386/kernel/nmi.c: export nmi_active
	* arch/i386/oprofile/nmi_timer_int.c: use it to check if owe can use
	  an nmi interrupt
parent 9d6f9be1
...@@ -42,7 +42,7 @@ extern void show_registers(struct pt_regs *regs); ...@@ -42,7 +42,7 @@ extern void show_registers(struct pt_regs *regs);
* be enabled * be enabled
* -1: the lapic NMI watchdog is disabled, but can be enabled * -1: the lapic NMI watchdog is disabled, but can be enabled
*/ */
static int nmi_active; int nmi_active;
#define K7_EVNTSEL_ENABLE (1 << 22) #define K7_EVNTSEL_ENABLE (1 << 22)
#define K7_EVNTSEL_INT (1 << 20) #define K7_EVNTSEL_INT (1 << 20)
...@@ -462,6 +462,7 @@ void nmi_watchdog_tick (struct pt_regs * regs) ...@@ -462,6 +462,7 @@ void nmi_watchdog_tick (struct pt_regs * regs)
} }
} }
EXPORT_SYMBOL(nmi_active);
EXPORT_SYMBOL(nmi_watchdog); EXPORT_SYMBOL(nmi_watchdog);
EXPORT_SYMBOL(disable_lapic_nmi_watchdog); EXPORT_SYMBOL(disable_lapic_nmi_watchdog);
EXPORT_SYMBOL(enable_lapic_nmi_watchdog); EXPORT_SYMBOL(enable_lapic_nmi_watchdog);
......
...@@ -48,9 +48,13 @@ static struct oprofile_operations nmi_timer_ops = { ...@@ -48,9 +48,13 @@ static struct oprofile_operations nmi_timer_ops = {
.cpu_type = "timer" .cpu_type = "timer"
}; };
int __init nmi_timer_init(struct oprofile_operations ** ops) int __init nmi_timer_init(struct oprofile_operations ** ops)
{ {
extern int nmi_active;
if (nmi_active <= 0)
return -ENODEV;
*ops = &nmi_timer_ops; *ops = &nmi_timer_ops;
printk(KERN_INFO "oprofile: using NMI timer interrupt.\n"); printk(KERN_INFO "oprofile: using NMI timer interrupt.\n");
return 0; return 0;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
* be enabled * be enabled
* -1: the lapic NMI watchdog is disabled, but can be enabled * -1: the lapic NMI watchdog is disabled, but can be enabled
*/ */
static int nmi_active; int nmi_active; /* oprofile uses this */
static int panic_on_timeout; static int panic_on_timeout;
unsigned int nmi_watchdog = NMI_LOCAL_APIC; unsigned int nmi_watchdog = NMI_LOCAL_APIC;
...@@ -380,6 +380,7 @@ void unset_nmi_callback(void) ...@@ -380,6 +380,7 @@ void unset_nmi_callback(void)
nmi_callback = dummy_nmi_callback; nmi_callback = dummy_nmi_callback;
} }
EXPORT_SYMBOL(nmi_active);
EXPORT_SYMBOL(nmi_watchdog); EXPORT_SYMBOL(nmi_watchdog);
EXPORT_SYMBOL(disable_lapic_nmi_watchdog); EXPORT_SYMBOL(disable_lapic_nmi_watchdog);
EXPORT_SYMBOL(enable_lapic_nmi_watchdog); EXPORT_SYMBOL(enable_lapic_nmi_watchdog);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment