for (i = 0; i < dt_idle_states; i++) {
unsigned int exit_latency, target_residency;
+ bool stops_timebase = false;
/*
* If an idle state has exit latency beyond
* POWERNV_THRESHOLD_LATENCY_NS then don't use it
}
}
+ if (flags[i] & OPAL_PM_TIMEBASE_STOP)
+ stops_timebase = true;
+
/*
* For nap and fastsleep, use default target_residency
* values if f/w does not expose it.
add_powernv_state(nr_idle_states, "Nap",
CPUIDLE_FLAG_NONE, nap_loop,
target_residency, exit_latency, 0, 0);
- } else if ((flags[i] & OPAL_PM_STOP_INST_FAST) &&
- !(flags[i] & OPAL_PM_TIMEBASE_STOP)) {
+ } else if (has_stop_states && !stops_timebase) {
add_powernv_state(nr_idle_states, names[i],
CPUIDLE_FLAG_NONE, stop_loop,
target_residency, exit_latency,
* within this config dependency check.
*/
#ifdef CONFIG_TICK_ONESHOT
- if (flags[i] & OPAL_PM_SLEEP_ENABLED ||
- flags[i] & OPAL_PM_SLEEP_ENABLED_ER1) {
+ else if (flags[i] & OPAL_PM_SLEEP_ENABLED ||
+ flags[i] & OPAL_PM_SLEEP_ENABLED_ER1) {
if (!rc)
target_residency = 300000;
/* Add FASTSLEEP state */
CPUIDLE_FLAG_TIMER_STOP,
fastsleep_loop,
target_residency, exit_latency, 0, 0);
- } else if ((flags[i] & OPAL_PM_STOP_INST_DEEP) &&
- (flags[i] & OPAL_PM_TIMEBASE_STOP)) {
+ } else if (has_stop_states && stops_timebase) {
add_powernv_state(nr_idle_states, names[i],
CPUIDLE_FLAG_TIMER_STOP, stop_loop,
target_residency, exit_latency,
psscr_val[i], psscr_mask[i]);
}
#endif
+ else
+ continue;
nr_idle_states++;
}
out: