Lines Matching defs:drv
225 * @drv: cpuidle driver containing state data.
228 static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
243 u64 lat_ns = drv->states[dev->last_state_idx].exit_latency_ns;
272 for (i = 0; i < drv->state_count; i++) {
280 target_residency_ns = drv->states[i].target_residency_ns;
308 idx_timer = drv->state_count;
335 static bool teo_state_ok(int i, struct cpuidle_driver *drv)
338 drv->states[i].target_residency_ns >= TICK_NSEC;
343 * @drv: cpuidle driver containing state data.
349 static int teo_find_shallower_state(struct cpuidle_driver *drv,
357 (no_poll && drv->states[i].flags & CPUIDLE_FLAG_POLLING))
361 if (drv->states[i].target_residency_ns <= duration_ns)
369 * @drv: cpuidle driver containing state data.
373 static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev,
394 teo_update(drv, dev);
406 if (drv->state_count < 2) {
420 if (drv->state_count < 3 && cpu_utilized) {
429 if ((!idx && !(drv->states[0].flags & CPUIDLE_FLAG_POLLING) &&
430 teo_state_ok(0, drv)) || dev->states_usage[1].disable) {
436 duration_ns = drv->states[1].target_residency_ns;
441 for (i = 1; i < drv->state_count; i++) {
443 struct cpuidle_state *s = &drv->states[i];
481 duration_ns = drv->states[idx].target_residency_ns;
486 cpu_data->state_bins[drv->state_count-1].intercepts;
528 if (teo_state_ok(i, drv) &&
540 if (!teo_state_ok(i, drv)) {
570 i = teo_find_shallower_state(drv, dev, idx, KTIME_MAX, true);
571 if (teo_state_ok(i, drv))
587 if ((drv->states[0].flags & CPUIDLE_FLAG_POLLING) &&
588 drv->states[idx].target_residency_ns < RESIDENCY_THRESHOLD_NS)
598 if (drv->states[idx].target_residency_ns > duration_ns) {
599 i = teo_find_shallower_state(drv, dev, idx, duration_ns, false);
600 if (teo_state_ok(i, drv))
609 if (drv->states[idx].target_residency_ns < TICK_NSEC &&
619 if ((!(drv->states[idx].flags & CPUIDLE_FLAG_POLLING) &&
629 drv->states[idx].target_residency_ns > delta_tick)
630 idx = teo_find_shallower_state(drv, dev, idx, delta_tick, false);
663 * @drv: cpuidle driver (not used).
666 static int teo_enable_device(struct cpuidle_driver *drv,