aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ia64/include/asm/processor.h5
-rw-r--r--arch/ia64/kernel/process.c6
-rw-r--r--arch/x86/include/asm/processor.h5
-rw-r--r--arch/x86/kernel/process.c24
-rw-r--r--drivers/acpi/processor_core.c4
-rw-r--r--drivers/acpi/processor_idle.c24
-rw-r--r--drivers/idle/intel_idle.c4
7 files changed, 32 insertions, 40 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
719extern unsigned long boot_option_idle_override; 719extern unsigned long boot_option_idle_override;
720extern unsigned long idle_halt; 720
721extern unsigned long idle_nomwait; 721enum 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
54void (*ia64_mark_idle)(int); 54void (*ia64_mark_idle)(int);
55 55
56unsigned long boot_option_idle_override = 0; 56unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE;
57EXPORT_SYMBOL(boot_option_idle_override); 57EXPORT_SYMBOL(boot_option_idle_override);
58unsigned long idle_halt;
59EXPORT_SYMBOL(idle_halt);
60unsigned long idle_nomwait;
61EXPORT_SYMBOL(idle_nomwait);
62void (*pm_idle) (void); 58void (*pm_idle) (void);
63EXPORT_SYMBOL(pm_idle); 59EXPORT_SYMBOL(pm_idle);
64void (*pm_power_off) (void); 60void (*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);
762extern void init_c1e_mask(void); 762extern void init_c1e_mask(void);
763 763
764extern unsigned long boot_option_idle_override; 764extern unsigned long boot_option_idle_override;
765extern unsigned long idle_halt;
766extern unsigned long idle_nomwait;
767extern bool c1e_detected; 765extern bool c1e_detected;
768 766
767enum idle_boot_override {IDLE_NO_OVERRIDE=0, IDLE_HALT, IDLE_NOMWAIT,
768 IDLE_POLL, IDLE_FORCE_MWAIT};
769
769extern void enable_sep_cpu(void); 770extern void enable_sep_cpu(void);
770extern int sysenter_setup(void); 771extern 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
25unsigned long idle_halt;
26EXPORT_SYMBOL(idle_halt);
27unsigned long idle_nomwait;
28EXPORT_SYMBOL(idle_nomwait);
29
30struct kmem_cache *task_xstate_cachep; 25struct kmem_cache *task_xstate_cachep;
31EXPORT_SYMBOL_GPL(task_xstate_cachep); 26EXPORT_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 */
331unsigned long boot_option_idle_override = 0; 326unsigned long boot_option_idle_override = IDLE_NO_OVERRIDE;
332EXPORT_SYMBOL(boot_option_idle_override); 327EXPORT_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 */
502static 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}
660early_param("idle", idle_setup); 652early_param("idle", idle_setup);
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index bec561c14beb..3c1a2fec8cda 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -23,7 +23,7 @@ static int set_no_mwait(const struct dmi_system_id *id)
23{ 23{
24 printk(KERN_NOTICE PREFIX "%s detected - " 24 printk(KERN_NOTICE PREFIX "%s detected - "
25 "disabling mwait for CPU C-states\n", id->ident); 25 "disabling mwait for CPU C-states\n", id->ident);
26 idle_nomwait = 1; 26 boot_option_idle_override = IDLE_NOMWAIT;
27 return 0; 27 return 0;
28} 28}
29 29
@@ -283,7 +283,7 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in)
283{ 283{
284 acpi_status status = AE_OK; 284 acpi_status status = AE_OK;
285 285
286 if (idle_nomwait) { 286 if (boot_option_idle_override == IDLE_NOMWAIT) {
287 /* 287 /*
288 * If mwait is disabled for CPU C-states, the C2C3_FFH access 288 * If mwait is disabled for CPU C-states, the C2C3_FFH access
289 * mode will be disabled in the parameter of _PDC object. 289 * mode will be disabled in the parameter of _PDC object.
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index dcb38f8ddfda..eefd4aa0e71d 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -79,6 +79,13 @@ module_param(bm_check_disable, uint, 0000);
79static unsigned int latency_factor __read_mostly = 2; 79static unsigned int latency_factor __read_mostly = 2;
80module_param(latency_factor, uint, 0644); 80module_param(latency_factor, uint, 0644);
81 81
82static int disabled_by_idle_boot_param(void)
83{
84 return boot_option_idle_override == IDLE_POLL ||
85 boot_option_idle_override == IDLE_FORCE_MWAIT ||
86 boot_option_idle_override == IDLE_HALT;
87}
88
82/* 89/*
83 * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3. 90 * IBM ThinkPad R40e crashes mysteriously when going into C2 or C3.
84 * For now disable this. Probably a bug somewhere else. 91 * For now disable this. Probably a bug somewhere else.
@@ -455,7 +462,7 @@ static int acpi_processor_get_power_info_cst(struct acpi_processor *pr)
455 continue; 462 continue;
456 } 463 }
457 if (cx.type == ACPI_STATE_C1 && 464 if (cx.type == ACPI_STATE_C1 &&
458 (idle_halt || idle_nomwait)) { 465 (boot_option_idle_override == IDLE_NOMWAIT)) {
459 /* 466 /*
460 * In most cases the C1 space_id obtained from 467 * In most cases the C1 space_id obtained from
461 * _CST object is FIXED_HARDWARE access mode. 468 * _CST object is FIXED_HARDWARE access mode.
@@ -1058,7 +1065,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
1058{ 1065{
1059 int ret = 0; 1066 int ret = 0;
1060 1067
1061 if (boot_option_idle_override) 1068 if (disabled_by_idle_boot_param())
1062 return 0; 1069 return 0;
1063 1070
1064 if (!pr) 1071 if (!pr)
@@ -1089,19 +1096,10 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1089 acpi_status status = 0; 1096 acpi_status status = 0;
1090 static int first_run; 1097 static int first_run;
1091 1098
1092 if (boot_option_idle_override) 1099 if (disabled_by_idle_boot_param())
1093 return 0; 1100 return 0;
1094 1101
1095 if (!first_run) { 1102 if (!first_run) {
1096 if (idle_halt) {
1097 /*
1098 * When the boot option of "idle=halt" is added, halt
1099 * is used for CPU IDLE.
1100 * In such case C2/C3 is meaningless. So the max_cstate
1101 * is set to one.
1102 */
1103 max_cstate = 1;
1104 }
1105 dmi_check_system(processor_power_dmi_table); 1103 dmi_check_system(processor_power_dmi_table);
1106 max_cstate = acpi_processor_cstate_check(max_cstate); 1104 max_cstate = acpi_processor_cstate_check(max_cstate);
1107 if (max_cstate < ACPI_C_STATES_MAX) 1105 if (max_cstate < ACPI_C_STATES_MAX)
@@ -1142,7 +1140,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1142int acpi_processor_power_exit(struct acpi_processor *pr, 1140int acpi_processor_power_exit(struct acpi_processor *pr,
1143 struct acpi_device *device) 1141 struct acpi_device *device)
1144{ 1142{
1145 if (boot_option_idle_override) 1143 if (disabled_by_idle_boot_param())
1146 return 0; 1144 return 0;
1147 1145
1148 cpuidle_unregister_device(&pr->power.dev); 1146 cpuidle_unregister_device(&pr->power.dev);
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 94a652625ae2..21d387132dbc 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -404,6 +404,10 @@ static int __init intel_idle_init(void)
404{ 404{
405 int retval; 405 int retval;
406 406
407 /* Do not load intel_idle at all for now if idle= is passed */
408 if (boot_option_idle_override != IDLE_NO_OVERRIDE)
409 return -ENODEV;
410
407 retval = intel_idle_probe(); 411 retval = intel_idle_probe();
408 if (retval) 412 if (retval)
409 return retval; 413 return retval;