aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_idle.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2014-11-12 10:03:50 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-11-12 15:17:27 -0500
commitb82b6cca488074da3852e8a54fde1d9f74bf1557 (patch)
tree20db4b6c0d6a0180610fa392f32db7aeea515321 /drivers/acpi/processor_idle.c
parent206c5f60a3d902bc4b56dab2de3e88de5eb06108 (diff)
cpuidle: Invert CPUIDLE_FLAG_TIME_VALID logic
The only place where the time is invalid is when the ACPI_CSTATE_FFH entry method is not set. Otherwise for all the drivers, the time can be correctly measured. Instead of duplicating the CPUIDLE_FLAG_TIME_VALID flag in all the drivers for all the states, just invert the logic by replacing it by the flag CPUIDLE_FLAG_TIME_INVALID, hence we can set this flag only for the acpi idle driver, remove the former flag from all the drivers and invert the logic with this flag in the different governor. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r--drivers/acpi/processor_idle.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 17f9ec501972..380b4b43f361 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -985,8 +985,8 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
985 state->flags = 0; 985 state->flags = 0;
986 switch (cx->type) { 986 switch (cx->type) {
987 case ACPI_STATE_C1: 987 case ACPI_STATE_C1:
988 if (cx->entry_method == ACPI_CSTATE_FFH) 988 if (cx->entry_method != ACPI_CSTATE_FFH)
989 state->flags |= CPUIDLE_FLAG_TIME_VALID; 989 state->flags |= CPUIDLE_FLAG_TIME_INVALID;
990 990
991 state->enter = acpi_idle_enter_c1; 991 state->enter = acpi_idle_enter_c1;
992 state->enter_dead = acpi_idle_play_dead; 992 state->enter_dead = acpi_idle_play_dead;
@@ -994,14 +994,12 @@ static int acpi_processor_setup_cpuidle_states(struct acpi_processor *pr)
994 break; 994 break;
995 995
996 case ACPI_STATE_C2: 996 case ACPI_STATE_C2:
997 state->flags |= CPUIDLE_FLAG_TIME_VALID;
998 state->enter = acpi_idle_enter_simple; 997 state->enter = acpi_idle_enter_simple;
999 state->enter_dead = acpi_idle_play_dead; 998 state->enter_dead = acpi_idle_play_dead;
1000 drv->safe_state_index = count; 999 drv->safe_state_index = count;
1001 break; 1000 break;
1002 1001
1003 case ACPI_STATE_C3: 1002 case ACPI_STATE_C3:
1004 state->flags |= CPUIDLE_FLAG_TIME_VALID;
1005 state->enter = pr->flags.bm_check ? 1003 state->enter = pr->flags.bm_check ?
1006 acpi_idle_enter_bm : 1004 acpi_idle_enter_bm :
1007 acpi_idle_enter_simple; 1005 acpi_idle_enter_simple;