Lines Matching +full:idle +full:- +full:mode +full:- +full:mask

1 // SPDX-License-Identifier: GPL-2.0
3 * cpuidle-powernv - idle state cpuidle driver.
4 * Adapted from drivers/cpuidle/cpuidle-pseries
26 * Expose only those Hardware idle states via the cpuidle framework
41 u64 mask; member
58 for (i = index + 1; i < drv->state_count; i++) { in get_snooze_timeout()
59 if (dev->states_usage[i].disable) in get_snooze_timeout()
62 return drv->states[i].target_residency * tb_ticks_per_usec; in get_snooze_timeout()
112 /* Register for fastsleep only in oneshot mode of broadcast */
145 stop_psscr_table[index].mask); in stop_loop()
193 drv->state_count = 0; in powernv_cpuidle_driver_init()
200 drv->states[drv->state_count] = /* structure copy */ in powernv_cpuidle_driver_init()
203 drv->state_count += 1; in powernv_cpuidle_driver_init()
213 * drv->cpumask defaults to cpu_possible_mask in in powernv_cpuidle_driver_init()
216 * cannot be hot-added later at run time. in powernv_cpuidle_driver_init()
219 * incorrect, so pass a correct CPU mask to the generic cpuidle driver. in powernv_cpuidle_driver_init()
222 drv->cpumask = (struct cpumask *)cpu_present_mask; in powernv_cpuidle_driver_init()
244 stop_psscr_table[index].mask = psscr_mask; in add_powernv_state()
259 pr_warn("cpuidle-powernv : Only Snooze is available\n"); in powernv_add_idle_states()
267 * Since snooze is used as first idle state, max idle states allowed is in powernv_add_idle_states()
268 * CPUIDLE_STATE_MAX -1 in powernv_add_idle_states()
270 if (nr_pnv_idle_states > CPUIDLE_STATE_MAX - 1) { in powernv_add_idle_states()
271 pr_warn("cpuidle-powernv: discovered idle states more than allowed"); in powernv_add_idle_states()
272 dt_idle_states = CPUIDLE_STATE_MAX - 1; in powernv_add_idle_states()
276 * If the idle states use stop instruction, probe for psscr values in powernv_add_idle_states()
277 * and psscr mask which are necessary to specify required stop level. in powernv_add_idle_states()
288 * Skip the platform idle state whose flag isn't in in powernv_add_idle_states()
289 * the supported_cpuidle_states flag mask. in powernv_add_idle_states()
291 if ((state->flags & supported_flags) != state->flags) in powernv_add_idle_states()
294 * If an idle state has exit latency beyond in powernv_add_idle_states()
296 * in cpu-idle. in powernv_add_idle_states()
298 if (state->latency_ns > POWERNV_THRESHOLD_LATENCY_NS) in powernv_add_idle_states()
304 exit_latency = DIV_ROUND_UP(state->latency_ns, 1000); in powernv_add_idle_states()
305 target_residency = DIV_ROUND_UP(state->residency_ns, 1000); in powernv_add_idle_states()
307 if (has_stop_states && !(state->valid)) in powernv_add_idle_states()
310 if (state->flags & OPAL_PM_TIMEBASE_STOP) in powernv_add_idle_states()
313 if (state->flags & OPAL_PM_NAP_ENABLED) { in powernv_add_idle_states()
319 add_powernv_state(nr_idle_states, state->name, in powernv_add_idle_states()
322 state->psscr_val, in powernv_add_idle_states()
323 state->psscr_mask); in powernv_add_idle_states()
331 else if (state->flags & OPAL_PM_SLEEP_ENABLED || in powernv_add_idle_states()
332 state->flags & OPAL_PM_SLEEP_ENABLED_ER1) { in powernv_add_idle_states()
339 add_powernv_state(nr_idle_states, state->name, in powernv_add_idle_states()
342 state->psscr_val, in powernv_add_idle_states()
343 state->psscr_mask); in powernv_add_idle_states()
361 return -ENODEV; in powernv_idle_probe()
365 /* Device tree can indicate more idle states */ in powernv_idle_probe()
371 return -ENODEV; in powernv_idle_probe()