Skip to content

Commit

Permalink
intel_idle: allow idle states to be freeze-mode specific
Browse files Browse the repository at this point in the history
intel_idle uses a NULL "enter" field in a cpuidle state
to recognize the invalid entry terminating a variable-length array.

Linux-4.0 added support for the system-wide "freeze" state
in cpuidle drivers via the new "enter_freeze" field.

The natural way to expose a deep idle state for freeze,
but not for run-time idle is to supply "enter_freeze" without "enter";
so we update the driver to accept such states.

Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
lenb committed Jul 26, 2015
1 parent 26ae19a commit 7dd0e0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/idle/intel_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,8 @@ static int __init intel_idle_cpuidle_driver_init(void)
for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) {
int num_substates, mwait_hint, mwait_cstate;

if (cpuidle_state_table[cstate].enter == NULL)
if ((cpuidle_state_table[cstate].enter == NULL) &&
(cpuidle_state_table[cstate].enter_freeze == NULL))
break;

if (cstate + 1 > max_cstate) {
Expand Down

0 comments on commit 7dd0e0a

Please sign in to comment.