[PATCH] x86: Add acpi_user_timer_override option for Asus boards

Timer overrides are normally disabled on Nvidia board because
they are commonly wrong, except on new ones with HPET support.
Unfortunately there are quite some Asus boards around that
don't have HPET, but need a timer override.

We don't know yet how to handle this transparently,
but at least add a command line option to force the timer override
and let them boot.

Cc: len.brown@intel.com

Signed-off-by: Andi Kleen <ak@suse.de>

authored by Andi Kleen and committed by Andi Kleen fa18f477 15803a43

+29 -1
+4
Documentation/kernel-parameters.txt
··· 164 164 acpi_skip_timer_override [HW,ACPI] 165 165 Recognize and ignore IRQ0/pin2 Interrupt Override. 166 166 For broken nForce2 BIOS resulting in XT-PIC timer. 167 + acpi_use_timer_override [HW,ACPI} 168 + Use timer override. For some broken Nvidia NF5 boards 169 + that require a timer override, but don't have 170 + HPET 167 171 168 172 acpi_dbg_layer= [HW,ACPI] 169 173 Format: <int>
+8
arch/i386/kernel/acpi/boot.c
··· 82 82 acpi_interrupt_flags acpi_sci_flags __initdata; 83 83 int acpi_sci_override_gsi __initdata; 84 84 int acpi_skip_timer_override __initdata; 85 + int acpi_use_timer_override __initdata; 85 86 86 87 #ifdef CONFIG_X86_LOCAL_APIC 87 88 static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; ··· 1301 1300 return 0; 1302 1301 } 1303 1302 early_param("acpi_skip_timer_override", parse_acpi_skip_timer_override); 1303 + 1304 + static int __init parse_acpi_use_timer_override(char *arg) 1305 + { 1306 + acpi_use_timer_override = 1; 1307 + return 0; 1308 + } 1309 + early_param("acpi_use_timer_override", parse_acpi_use_timer_override); 1304 1310 #endif /* CONFIG_X86_IO_APIC */ 1305 1311 1306 1312 static int __init setup_acpi_sci(char *s)
+7 -1
arch/i386/kernel/acpi/earlyquirk.c
··· 27 27 #ifdef CONFIG_ACPI 28 28 /* According to Nvidia all timer overrides are bogus unless HPET 29 29 is enabled. */ 30 - if (vendor == PCI_VENDOR_ID_NVIDIA) { 30 + if (!acpi_use_timer_override && vendor == PCI_VENDOR_ID_NVIDIA) { 31 31 nvidia_hpet_detected = 0; 32 32 acpi_table_parse(ACPI_HPET, nvidia_hpet_check); 33 33 if (nvidia_hpet_detected == 0) { 34 34 acpi_skip_timer_override = 1; 35 + printk(KERN_INFO "Nvidia board " 36 + "detected. Ignoring ACPI " 37 + "timer override.\n"); 38 + printk(KERN_INFO "If you got timer trouble " 39 + "try acpi_use_timer_override\n"); 40 + 35 41 } 36 42 } 37 43 #endif
+8
arch/x86_64/kernel/early-quirks.c
··· 45 45 /* 46 46 * All timer overrides on Nvidia are 47 47 * wrong unless HPET is enabled. 48 + * Unfortunately that's not true on many Asus boards. 49 + * We don't know yet how to detect this automatically, but 50 + * at least allow a command line override. 48 51 */ 52 + if (acpi_use_timer_override) 53 + return; 54 + 49 55 nvidia_hpet_detected = 0; 50 56 acpi_table_parse(ACPI_HPET, nvidia_hpet_check); 51 57 if (nvidia_hpet_detected == 0) { ··· 59 53 printk(KERN_INFO "Nvidia board " 60 54 "detected. Ignoring ACPI " 61 55 "timer override.\n"); 56 + printk(KERN_INFO "If you got timer trouble " 57 + "try acpi_use_timer_override\n"); 62 58 } 63 59 #endif 64 60 /* RED-PEN skip them on mptables too? */
+1
include/asm-i386/acpi.h
··· 132 132 133 133 #ifdef CONFIG_X86_IO_APIC 134 134 extern int acpi_skip_timer_override; 135 + extern int acpi_use_timer_override; 135 136 #endif 136 137 137 138 static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
+1
include/asm-x86_64/acpi.h
··· 163 163 #define ARCH_HAS_POWER_INIT 1 164 164 165 165 extern int acpi_skip_timer_override; 166 + extern int acpi_use_timer_override; 166 167 167 168 #endif /*__KERNEL__*/ 168 169