aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/processor_core.c4
-rw-r--r--drivers/acpi/processor_idle.c28
2 files changed, 13 insertions, 19 deletions
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 a765b823aa9e..d615b7d69bca 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.
@@ -1016,7 +1023,6 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
1016 state->flags = 0; 1023 state->flags = 0;
1017 switch (cx->type) { 1024 switch (cx->type) {
1018 case ACPI_STATE_C1: 1025 case ACPI_STATE_C1:
1019 state->flags |= CPUIDLE_FLAG_SHALLOW;
1020 if (cx->entry_method == ACPI_CSTATE_FFH) 1026 if (cx->entry_method == ACPI_CSTATE_FFH)
1021 state->flags |= CPUIDLE_FLAG_TIME_VALID; 1027 state->flags |= CPUIDLE_FLAG_TIME_VALID;
1022 1028
@@ -1025,16 +1031,13 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
1025 break; 1031 break;
1026 1032
1027 case ACPI_STATE_C2: 1033 case ACPI_STATE_C2:
1028 state->flags |= CPUIDLE_FLAG_BALANCED;
1029 state->flags |= CPUIDLE_FLAG_TIME_VALID; 1034 state->flags |= CPUIDLE_FLAG_TIME_VALID;
1030 state->enter = acpi_idle_enter_simple; 1035 state->enter = acpi_idle_enter_simple;
1031 dev->safe_state = state; 1036 dev->safe_state = state;
1032 break; 1037 break;
1033 1038
1034 case ACPI_STATE_C3: 1039 case ACPI_STATE_C3:
1035 state->flags |= CPUIDLE_FLAG_DEEP;
1036 state->flags |= CPUIDLE_FLAG_TIME_VALID; 1040 state->flags |= CPUIDLE_FLAG_TIME_VALID;
1037 state->flags |= CPUIDLE_FLAG_CHECK_BM;
1038 state->enter = pr->flags.bm_check ? 1041 state->enter = pr->flags.bm_check ?
1039 acpi_idle_enter_bm : 1042 acpi_idle_enter_bm :
1040 acpi_idle_enter_simple; 1043 acpi_idle_enter_simple;
@@ -1058,7 +1061,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr)
1058{ 1061{
1059 int ret = 0; 1062 int ret = 0;
1060 1063
1061 if (boot_option_idle_override) 1064 if (disabled_by_idle_boot_param())
1062 return 0; 1065 return 0;
1063 1066
1064 if (!pr) 1067 if (!pr)
@@ -1089,19 +1092,10 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1089 acpi_status status = 0; 1092 acpi_status status = 0;
1090 static int first_run; 1093 static int first_run;
1091 1094
1092 if (boot_option_idle_override) 1095 if (disabled_by_idle_boot_param())
1093 return 0; 1096 return 0;
1094 1097
1095 if (!first_run) { 1098 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); 1099 dmi_check_system(processor_power_dmi_table);
1106 max_cstate = acpi_processor_cstate_check(max_cstate); 1100 max_cstate = acpi_processor_cstate_check(max_cstate);
1107 if (max_cstate < ACPI_C_STATES_MAX) 1101 if (max_cstate < ACPI_C_STATES_MAX)
@@ -1142,7 +1136,7 @@ int __cpuinit acpi_processor_power_init(struct acpi_processor *pr,
1142int acpi_processor_power_exit(struct acpi_processor *pr, 1136int acpi_processor_power_exit(struct acpi_processor *pr,
1143 struct acpi_device *device) 1137 struct acpi_device *device)
1144{ 1138{
1145 if (boot_option_idle_override) 1139 if (disabled_by_idle_boot_param())
1146 return 0; 1140 return 0;
1147 1141
1148 cpuidle_unregister_device(&pr->power.dev); 1142 cpuidle_unregister_device(&pr->power.dev);