Skip to content

Commit

Permalink
cpuidle / menu: Return (-1) if there are no suitable states
Browse files Browse the repository at this point in the history
If there is a PM QoS latency limit and all of the sufficiently shallow
C-states are disabled, the cpuidle menu governor returns 0 which on
some systems is CPUIDLE_DRIVER_STATE_START and shouldn't be returned
if that C-state has been disabled.

Fix the issue by modifying the menu governor to return (-1) in such
situations.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Rafael J. Wysocki committed Apr 30, 2014
1 parent 52c324f commit 3836785
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cpuidle/governors/menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
data->needs_update = 0;
}

data->last_state_idx = 0;
data->last_state_idx = CPUIDLE_DRIVER_STATE_START - 1;

/* Special case when user has set very strict latency requirement */
if (unlikely(latency_req == 0))
Expand Down

0 comments on commit 3836785

Please sign in to comment.