diff options
| -rw-r--r-- | drivers/idle/intel_idle.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 8e1939f564f4..057ffef37b42 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
| @@ -584,7 +584,7 @@ static int __init intel_idle_cpuidle_driver_init(void) | |||
| 584 | drv->state_count = 1; | 584 | drv->state_count = 1; |
| 585 | 585 | ||
| 586 | for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) { | 586 | for (cstate = 0; cstate < CPUIDLE_STATE_MAX; ++cstate) { |
| 587 | int num_substates, mwait_hint, mwait_cstate, mwait_substate; | 587 | int num_substates, mwait_hint, mwait_cstate; |
| 588 | 588 | ||
| 589 | if (cpuidle_state_table[cstate].enter == NULL) | 589 | if (cpuidle_state_table[cstate].enter == NULL) |
| 590 | break; | 590 | break; |
| @@ -597,14 +597,13 @@ static int __init intel_idle_cpuidle_driver_init(void) | |||
| 597 | 597 | ||
| 598 | mwait_hint = flg2MWAIT(cpuidle_state_table[cstate].flags); | 598 | mwait_hint = flg2MWAIT(cpuidle_state_table[cstate].flags); |
| 599 | mwait_cstate = MWAIT_HINT2CSTATE(mwait_hint); | 599 | mwait_cstate = MWAIT_HINT2CSTATE(mwait_hint); |
| 600 | mwait_substate = MWAIT_HINT2SUBSTATE(mwait_hint); | ||
| 601 | 600 | ||
| 602 | /* does the state exist in CPUID.MWAIT? */ | 601 | /* number of sub-states for this state in CPUID.MWAIT */ |
| 603 | num_substates = (mwait_substates >> ((mwait_cstate + 1) * 4)) | 602 | num_substates = (mwait_substates >> ((mwait_cstate + 1) * 4)) |
| 604 | & MWAIT_SUBSTATE_MASK; | 603 | & MWAIT_SUBSTATE_MASK; |
| 605 | 604 | ||
| 606 | /* if sub-state in table is not enumerated by CPUID */ | 605 | /* if NO sub-states for this state in CPUID, skip it */ |
| 607 | if ((mwait_substate + 1) > num_substates) | 606 | if (num_substates == 0) |
| 608 | continue; | 607 | continue; |
| 609 | 608 | ||
| 610 | if (((mwait_cstate + 1) > 2) && | 609 | if (((mwait_cstate + 1) > 2) && |
