diff options
author | Thomas Renninger <trenn@suse.de> | 2010-11-03 12:06:14 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 12:47:30 -0500 |
commit | d18960494f65ca4fa0d67c865aaca99452070d15 (patch) | |
tree | 93c37d0dd4bf8c254b312f75eb97f54077a9baed /arch | |
parent | d8c216cfa57e8a579f41729cbb88c97835d9ac8d (diff) |
ACPI, intel_idle: Cleanup idle= internal variables
Having four variables for the same thing:
idle_halt, idle_nomwait, force_mwait and boot_option_idle_overrides
is rather confusing and unnecessary complex.
if idle= boot param is passed, only set up one variable:
boot_option_idle_overrides
Introduces following functional changes/fixes:
- intel_idle driver does not register if any idle=xy
boot param is passed.
- processor_idle.c will also not register a cpuidle driver
and get active if idle=halt is passed.
Before a cpuidle driver with one (C1, halt) state got registered
Now the default_idle function will be used which finally uses
the same idle call to enter sleep state (safe_halt()), but
without registering a whole cpuidle driver.
That means idle= param will always avoid cpuidle drivers to register
with one exception (same behavior as before):
idle=nomwait
may still register acpi_idle cpuidle driver, but C1 will not use
mwait, but hlt. This can be a workaround for IO based deeper sleep
states where C1 mwait causes problems.
Signed-off-by: Thomas Renninger <trenn@suse.de>
cc: x86@kernel.org
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ia64/include/asm/processor.h | 5 | ||||
-rw-r--r-- | arch/ia64/kernel/process.c | 6 | ||||
-rw-r--r-- | arch/x86/include/asm/processor.h | 5 | ||||
-rw-r--r-- | arch/x86/kernel/process.c | 24 |
4 files changed, 15 insertions, 25 deletions
diff --git a/arch/ia64/include/asm/processor.h b/arch/ia64/include/asm/processor.h index 348e44d08ce3..03afe7970748 100644 --- a/arch/ia64/include/asm/processor.h +++ b/arch/ia64/include/asm/processor.h | |||
@@ -717,8 +717,9 @@ prefetchw (const void *x) | |||
717 | #define spin_lock_prefetch(x) prefetchw(x) | 717 | #define spin_lock_prefetch(x) prefetchw(x) |
718 | 718 | ||
719 | extern unsigned long boot_option_idle_override; | 719 | extern unsigned long boot_option_idle_override; |
720 | extern unsigned long idle_halt; | 720 | |
721 | extern unsigned long idle_nomwait; | 721 | enum idle_boot_override {IDLE_NO_OVERRIDE=0, IDLE_HALT, IDLE_FORCE_MWAIT, |
722 | IDLE_NOMWAIT, IDLE_POLL}; | ||
722 | 723 | ||
723 | #endif /* !__ASSEMBLY__ */ | 724 | #endif /* !__ASSEMBLY__ */ |
724 | 725 | ||
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 16f1c7b04c69..6d33c5cc94f0 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
@@ -53,12 +53,8 @@ | |||
53 | 53 | ||
54 | void (*ia64_mark_idle)(int); | 54 | void (*ia64_mark_idle)(int); |
55 | 55 | ||
56 | unsigned long boot_option_idle_override = 0; | 56 | unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE; |
57 | EXPORT_SYMBOL(boot_option_idle_override); | 57 | EXPORT_SYMBOL(boot_option_idle_override); |
58 | unsigned long idle_halt; | ||
59 | EXPORT_SYMBOL(idle_halt); | ||
60 | unsigned long idle_nomwait; | ||
61 | EXPORT_SYMBOL(idle_nomwait); | ||
62 | void (*pm_idle) (void); | 58 | void (*pm_idle) (void); |
63 | EXPORT_SYMBOL(pm_idle); | 59 | EXPORT_SYMBOL(pm_idle); |
64 | void (*pm_power_off) (void); | 60 | void (*pm_power_off) (void); |
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index cae9c3cb95cf..b79bd980461c 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -762,10 +762,11 @@ extern void select_idle_routine(const struct cpuinfo_x86 *c); | |||
762 | extern void init_c1e_mask(void); | 762 | extern void init_c1e_mask(void); |
763 | 763 | ||
764 | extern unsigned long boot_option_idle_override; | 764 | extern unsigned long boot_option_idle_override; |
765 | extern unsigned long idle_halt; | ||
766 | extern unsigned long idle_nomwait; | ||
767 | extern bool c1e_detected; | 765 | extern bool c1e_detected; |
768 | 766 | ||
767 | enum idle_boot_override {IDLE_NO_OVERRIDE=0, IDLE_HALT, IDLE_NOMWAIT, | ||
768 | IDLE_POLL, IDLE_FORCE_MWAIT}; | ||
769 | |||
769 | extern void enable_sep_cpu(void); | 770 | extern void enable_sep_cpu(void); |
770 | extern int sysenter_setup(void); | 771 | extern int sysenter_setup(void); |
771 | 772 | ||
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index 57d1868a86aa..b6472153e45b 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -22,11 +22,6 @@ | |||
22 | #include <asm/i387.h> | 22 | #include <asm/i387.h> |
23 | #include <asm/debugreg.h> | 23 | #include <asm/debugreg.h> |
24 | 24 | ||
25 | unsigned long idle_halt; | ||
26 | EXPORT_SYMBOL(idle_halt); | ||
27 | unsigned long idle_nomwait; | ||
28 | EXPORT_SYMBOL(idle_nomwait); | ||
29 | |||
30 | struct kmem_cache *task_xstate_cachep; | 25 | struct kmem_cache *task_xstate_cachep; |
31 | EXPORT_SYMBOL_GPL(task_xstate_cachep); | 26 | EXPORT_SYMBOL_GPL(task_xstate_cachep); |
32 | 27 | ||
@@ -328,7 +323,7 @@ long sys_execve(const char __user *name, | |||
328 | /* | 323 | /* |
329 | * Idle related variables and functions | 324 | * Idle related variables and functions |
330 | */ | 325 | */ |
331 | unsigned long boot_option_idle_override = 0; | 326 | unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE; |
332 | EXPORT_SYMBOL(boot_option_idle_override); | 327 | EXPORT_SYMBOL(boot_option_idle_override); |
333 | 328 | ||
334 | /* | 329 | /* |
@@ -499,7 +494,6 @@ static void poll_idle(void) | |||
499 | * | 494 | * |
500 | * idle=mwait overrides this decision and forces the usage of mwait. | 495 | * idle=mwait overrides this decision and forces the usage of mwait. |
501 | */ | 496 | */ |
502 | static int __cpuinitdata force_mwait; | ||
503 | 497 | ||
504 | #define MWAIT_INFO 0x05 | 498 | #define MWAIT_INFO 0x05 |
505 | #define MWAIT_ECX_EXTENDED_INFO 0x01 | 499 | #define MWAIT_ECX_EXTENDED_INFO 0x01 |
@@ -509,7 +503,7 @@ static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c) | |||
509 | { | 503 | { |
510 | u32 eax, ebx, ecx, edx; | 504 | u32 eax, ebx, ecx, edx; |
511 | 505 | ||
512 | if (force_mwait) | 506 | if (boot_option_idle_override == IDLE_FORCE_MWAIT) |
513 | return 1; | 507 | return 1; |
514 | 508 | ||
515 | if (c->cpuid_level < MWAIT_INFO) | 509 | if (c->cpuid_level < MWAIT_INFO) |
@@ -629,9 +623,10 @@ static int __init idle_setup(char *str) | |||
629 | if (!strcmp(str, "poll")) { | 623 | if (!strcmp(str, "poll")) { |
630 | printk("using polling idle threads.\n"); | 624 | printk("using polling idle threads.\n"); |
631 | pm_idle = poll_idle; | 625 | pm_idle = poll_idle; |
632 | } else if (!strcmp(str, "mwait")) | 626 | boot_option_idle_override = IDLE_POLL; |
633 | force_mwait = 1; | 627 | } else if (!strcmp(str, "mwait")) { |
634 | else if (!strcmp(str, "halt")) { | 628 | boot_option_idle_override = IDLE_FORCE_MWAIT; |
629 | } else if (!strcmp(str, "halt")) { | ||
635 | /* | 630 | /* |
636 | * When the boot option of idle=halt is added, halt is | 631 | * When the boot option of idle=halt is added, halt is |
637 | * forced to be used for CPU idle. In such case CPU C2/C3 | 632 | * forced to be used for CPU idle. In such case CPU C2/C3 |
@@ -640,8 +635,7 @@ static int __init idle_setup(char *str) | |||
640 | * the boot_option_idle_override. | 635 | * the boot_option_idle_override. |
641 | */ | 636 | */ |
642 | pm_idle = default_idle; | 637 | pm_idle = default_idle; |
643 | idle_halt = 1; | 638 | boot_option_idle_override = IDLE_HALT; |
644 | return 0; | ||
645 | } else if (!strcmp(str, "nomwait")) { | 639 | } else if (!strcmp(str, "nomwait")) { |
646 | /* | 640 | /* |
647 | * If the boot option of "idle=nomwait" is added, | 641 | * If the boot option of "idle=nomwait" is added, |
@@ -649,12 +643,10 @@ static int __init idle_setup(char *str) | |||
649 | * states. In such case it won't touch the variable | 643 | * states. In such case it won't touch the variable |
650 | * of boot_option_idle_override. | 644 | * of boot_option_idle_override. |
651 | */ | 645 | */ |
652 | idle_nomwait = 1; | 646 | boot_option_idle_override = IDLE_NOMWAIT; |
653 | return 0; | ||
654 | } else | 647 | } else |
655 | return -1; | 648 | return -1; |
656 | 649 | ||
657 | boot_option_idle_override = 1; | ||
658 | return 0; | 650 | return 0; |
659 | } | 651 | } |
660 | early_param("idle", idle_setup); | 652 | early_param("idle", idle_setup); |