Lines Matching refs:drv

156 static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)  in teo_update()  argument
172 u64 lat_ns = drv->states[dev->last_state_idx].exit_latency_ns; in teo_update()
196 for (i = 0; i < drv->state_count; i++) { in teo_update()
202 target_residency_ns = drv->states[i].target_residency_ns; in teo_update()
230 static bool teo_state_ok(int i, struct cpuidle_driver *drv) in teo_state_ok() argument
233 drv->states[i].target_residency_ns >= TICK_NSEC; in teo_state_ok()
244 static int teo_find_shallower_state(struct cpuidle_driver *drv, in teo_find_shallower_state() argument
252 (no_poll && drv->states[i].flags & CPUIDLE_FLAG_POLLING)) in teo_find_shallower_state()
256 if (drv->states[i].target_residency_ns <= duration_ns) in teo_find_shallower_state()
268 static int teo_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, in teo_select() argument
284 teo_update(drv, dev); in teo_select()
300 if (drv->state_count < 2) { in teo_select()
309 for (i = 1; i < drv->state_count; i++) { in teo_select()
311 struct cpuidle_state *s = &drv->states[i]; in teo_select()
347 duration_ns = drv->states[idx].target_residency_ns; in teo_select()
382 if (teo_state_ok(i, drv) && in teo_select()
394 if (teo_state_ok(i, drv)) { in teo_select()
446 if ((!idx || drv->states[idx].target_residency_ns < RESIDENCY_THRESHOLD_NS) && in teo_select()
461 if (drv->states[idx].target_residency_ns > duration_ns) { in teo_select()
462 i = teo_find_shallower_state(drv, dev, idx, duration_ns, false); in teo_select()
463 if (teo_state_ok(i, drv)) in teo_select()
472 if (drv->states[idx].target_residency_ns < TICK_NSEC && in teo_select()
482 if ((!(drv->states[idx].flags & CPUIDLE_FLAG_POLLING) && in teo_select()
492 drv->states[idx].target_residency_ns > delta_tick) in teo_select()
493 idx = teo_find_shallower_state(drv, dev, idx, delta_tick, false); in teo_select()
528 static int teo_enable_device(struct cpuidle_driver *drv, in teo_enable_device() argument