aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_idle.c
diff options
context:
space:
mode:
authorThomas Renninger <trenn@suse.de>2010-11-03 12:06:14 -0400
committerLen Brown <len.brown@intel.com>2011-01-12 12:47:30 -0500
commitd18960494f65ca4fa0d67c865aaca99452070d15 (patch)
tree93c37d0dd4bf8c254b312f75eb97f54077a9baed /drivers/acpi/processor_idle.c
parentd8c216cfa57e8a579f41729cbb88c97835d9ac8d (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 'drivers/acpi/processor_idle.c')
-rw-r--r--drivers/acpi/processor_idle.c24
1 files changed, 11 insertions, 13 deletions
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);