aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-03-08 20:57:25 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-08 21:10:31 -0500
commitf9262c12c0084ddba445a9a42e98994018e51400 (patch)
treeb54948e654e68c1e5263d955c76bf3a41dfa14da /arch
parent979ce809bab37cf438f0db22bfa732d01a84a8c2 (diff)
[PATCH] i386: port ATI timer fix from x86_64 to i386 II
ATI chipsets tend to generate double timer interrupts for the local APIC timer when both the 8254 and the IO-APIC timer pins are enabled. This is because they route it to both and the result is anded together and the CPU ends up processing it twice. This patch changes check_timer to disable the 8254 routing for interrupt 0. I think it would be safe on all chipsets actually (i tested it on a couple and it worked everywhere) and Windows seems to do it in a similar way, but to be conservative this patch only enables this mode on ATI (and adds options to enable/disable too) Ported over from a similar x86-64 change. I reused the ACPI earlyquirk infrastructure for the ATI bridge check, but tweaked it a bit to work even without ACPI. Inspired by a patch from Chuck Ebbert, but redone. Cc: Chuck Ebbert <76306.1226@compuserve.com> Cc: "Brown, Len" <len.brown@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/i386/kernel/Makefile2
-rw-r--r--arch/i386/kernel/acpi/Makefile2
-rw-r--r--arch/i386/kernel/acpi/boot.c3
-rw-r--r--arch/i386/kernel/acpi/earlyquirk.c8
-rw-r--r--arch/i386/kernel/io_apic.c19
-rw-r--r--arch/i386/kernel/setup.c4
6 files changed, 32 insertions, 6 deletions
diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile
index 53bb9a79e27..65656c033d7 100644
--- a/arch/i386/kernel/Makefile
+++ b/arch/i386/kernel/Makefile
@@ -11,7 +11,7 @@ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \
11 11
12obj-y += cpu/ 12obj-y += cpu/
13obj-y += timers/ 13obj-y += timers/
14obj-$(CONFIG_ACPI) += acpi/ 14obj-y += acpi/
15obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o 15obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o
16obj-$(CONFIG_MCA) += mca.o 16obj-$(CONFIG_MCA) += mca.o
17obj-$(CONFIG_X86_MSR) += msr.o 17obj-$(CONFIG_X86_MSR) += msr.o
diff --git a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile
index d51c7313cae..7e9ac99354f 100644
--- a/arch/i386/kernel/acpi/Makefile
+++ b/arch/i386/kernel/acpi/Makefile
@@ -1,4 +1,4 @@
1obj-y := boot.o 1obj-$(CONFIG_ACPI) += boot.o
2obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o 2obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o
3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o 3obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o
4 4
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 79577f0ace9..f1a21945963 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -1111,9 +1111,6 @@ int __init acpi_boot_table_init(void)
1111 disable_acpi(); 1111 disable_acpi();
1112 return error; 1112 return error;
1113 } 1113 }
1114#ifdef __i386__
1115 check_acpi_pci();
1116#endif
1117 1114
1118 acpi_table_parse(ACPI_BOOT, acpi_parse_sbf); 1115 acpi_table_parse(ACPI_BOOT, acpi_parse_sbf);
1119 1116
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c
index f1b9d2a46da..2e3b643a4dc 100644
--- a/arch/i386/kernel/acpi/earlyquirk.c
+++ b/arch/i386/kernel/acpi/earlyquirk.c
@@ -7,14 +7,22 @@
7#include <linux/pci.h> 7#include <linux/pci.h>
8#include <asm/pci-direct.h> 8#include <asm/pci-direct.h>
9#include <asm/acpi.h> 9#include <asm/acpi.h>
10#include <asm/apic.h>
10 11
11static int __init check_bridge(int vendor, int device) 12static int __init check_bridge(int vendor, int device)
12{ 13{
14#ifdef CONFIG_ACPI
13 /* According to Nvidia all timer overrides are bogus. Just ignore 15 /* According to Nvidia all timer overrides are bogus. Just ignore
14 them all. */ 16 them all. */
15 if (vendor == PCI_VENDOR_ID_NVIDIA) { 17 if (vendor == PCI_VENDOR_ID_NVIDIA) {
16 acpi_skip_timer_override = 1; 18 acpi_skip_timer_override = 1;
17 } 19 }
20#endif
21 if (vendor == PCI_VENDOR_ID_ATI && timer_over_8254 == 1) {
22 timer_over_8254 = 0;
23 printk(KERN_INFO "ATI board detected. Disabling timer routing "
24 "over 8254.\n");
25 }
18 return 0; 26 return 0;
19} 27}
20 28
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c
index 235822b3f41..39d9a5fa907 100644
--- a/arch/i386/kernel/io_apic.c
+++ b/arch/i386/kernel/io_apic.c
@@ -51,6 +51,8 @@ static struct { int pin, apic; } ioapic_i8259 = { -1, -1 };
51 51
52static DEFINE_SPINLOCK(ioapic_lock); 52static DEFINE_SPINLOCK(ioapic_lock);
53 53
54int timer_over_8254 __initdata = 1;
55
54/* 56/*
55 * Is the SiS APIC rmw bug present ? 57 * Is the SiS APIC rmw bug present ?
56 * -1 = don't know, 0 = no, 1 = yes 58 * -1 = don't know, 0 = no, 1 = yes
@@ -2267,7 +2269,8 @@ static inline void check_timer(void)
2267 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT); 2269 apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
2268 init_8259A(1); 2270 init_8259A(1);
2269 timer_ack = 1; 2271 timer_ack = 1;
2270 enable_8259A_irq(0); 2272 if (timer_over_8254 > 0)
2273 enable_8259A_irq(0);
2271 2274
2272 pin1 = find_isa_irq_pin(0, mp_INT); 2275 pin1 = find_isa_irq_pin(0, mp_INT);
2273 apic1 = find_isa_irq_apic(0, mp_INT); 2276 apic1 = find_isa_irq_apic(0, mp_INT);
@@ -2392,6 +2395,20 @@ void __init setup_IO_APIC(void)
2392 print_IO_APIC(); 2395 print_IO_APIC();
2393} 2396}
2394 2397
2398static int __init setup_disable_8254_timer(char *s)
2399{
2400 timer_over_8254 = -1;
2401 return 1;
2402}
2403static int __init setup_enable_8254_timer(char *s)
2404{
2405 timer_over_8254 = 2;
2406 return 1;
2407}
2408
2409__setup("disable_8254_timer", setup_disable_8254_timer);
2410__setup("enable_8254_timer", setup_enable_8254_timer);
2411
2395/* 2412/*
2396 * Called after all the initialization is done. If we didnt find any 2413 * Called after all the initialization is done. If we didnt find any
2397 * APIC bugs then we can allow the modify fast path 2414 * APIC bugs then we can allow the modify fast path
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c
index 51e513b4f72..ab62a9f4701 100644
--- a/arch/i386/kernel/setup.c
+++ b/arch/i386/kernel/setup.c
@@ -1599,6 +1599,10 @@ void __init setup_arch(char **cmdline_p)
1599 if (efi_enabled) 1599 if (efi_enabled)
1600 efi_map_memmap(); 1600 efi_map_memmap();
1601 1601
1602#ifdef CONFIG_X86_IO_APIC
1603 check_acpi_pci(); /* Checks more than just ACPI actually */
1604#endif
1605
1602#ifdef CONFIG_ACPI 1606#ifdef CONFIG_ACPI
1603 /* 1607 /*
1604 * Parse the ACPI tables for possible boot-time SMP configuration. 1608 * Parse the ACPI tables for possible boot-time SMP configuration.