[PATCH] i386: add command line option "local_apic_timer_c2_ok"
authorThomas Gleixner <tglx@linutronix.de>
Fri, 23 Mar 2007 15:08:01 +0000 (16:08 +0100)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 23 Mar 2007 17:21:02 +0000 (10:21 -0700)
It turned out that it is almost impossible to trust ACPI, BIOS & Co.
regarding the C states. This was the reason to switch the local apic
timer off in C2 state already. OTOH there are sane and well behaving
systems, which get punished by that decision.

Allow the user to confirm that the local apic timer is trustworthy in C2
state. This keeps the default behaviour on the safe side.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Documentation/kernel-parameters.txt
arch/i386/kernel/apic.c
drivers/acpi/processor_idle.c
include/asm-i386/apic.h

index e39ab0c99fbbeeeef9a8a2169c07e81f6daa0e51..09640a8f7cebfe6010937d781c751d688e856a97 100644 (file)
@@ -780,6 +780,9 @@ and is between 256 and 4096 characters. It is defined in the file
        lapic           [IA-32,APIC] Enable the local APIC even if BIOS
                        disabled it.
 
+       lapic_timer_c2_ok       [IA-32,APIC] trust the local apic timer in
+                       C2 power state.
+
        lasi=           [HW,SCSI] PARISC LASI driver for the 53c700 chip
                        Format: addr:<io>,irq:<irq>
 
index 244c3fe9b8c3acc754d79f51eac28a9ee456d93f..e88415282a6f0ebf3024c2a5b1165e95502686e2 100644 (file)
@@ -64,6 +64,9 @@ static int enable_local_apic __initdata = 0;
 static int local_apic_timer_verify_ok;
 /* Disable local APIC timer from the kernel commandline or via dmi quirk */
 static int local_apic_timer_disabled;
+/* Local APIC timer works in C2 */
+int local_apic_timer_c2_ok;
+EXPORT_SYMBOL_GPL(local_apic_timer_c2_ok);
 
 /*
  * Debug level, exported for io_apic.c
@@ -1232,6 +1235,13 @@ static int __init parse_disable_lapic_timer(char *arg)
 }
 early_param("nolapic_timer", parse_disable_lapic_timer);
 
+static int __init parse_lapic_timer_c2_ok(char *arg)
+{
+       local_apic_timer_c2_ok = 1;
+       return 0;
+}
+early_param("lapic_timer_c2_ok", parse_lapic_timer_c2_ok);
+
 static int __init apic_set_verbosity(char *str)
 {
        if (strcmp("debug", str) == 0)
index 60773005b8afacbe24024a9ea33e96cc578ac59d..cdf78943af4db915f1a54da4285cbca2cc1c42ac 100644 (file)
@@ -268,6 +268,7 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr,
                                   struct acpi_processor_cx *cx)
 {
        struct acpi_processor_power *pwr = &pr->power;
+       u8 type = local_apic_timer_c2_ok ? ACPI_STATE_C3 : ACPI_STATE_C2;
 
        /*
         * Check, if one of the previous states already marked the lapic
@@ -276,7 +277,7 @@ static void acpi_timer_check_state(int state, struct acpi_processor *pr,
        if (pwr->timer_broadcast_on_state < state)
                return;
 
-       if (cx->type >= ACPI_STATE_C2)
+       if (cx->type >= type)
                pr->power.timer_broadcast_on_state = state;
 }
 
index cc6b1652249aed9ed4251166b1b9c47a8cd27338..a19810a08ae908097b2ea9a6768ba587730b1122 100644 (file)
@@ -117,6 +117,7 @@ extern void enable_NMI_through_LVT0 (void * dummy);
 #define ARCH_APICTIMER_STOPS_ON_C3     1
 
 extern int timer_over_8254;
+extern int local_apic_timer_c2_ok;
 
 #else /* !CONFIG_X86_LOCAL_APIC */
 static inline void lapic_shutdown(void) { }