Lines Matching refs:gpstates

219 	struct global_pstate_info *gpstates = policy->driver_data;  in reset_gpstates()  local
221 gpstates->highest_lpstate_idx = 0; in reset_gpstates()
222 gpstates->elapsed_time = 0; in reset_gpstates()
223 gpstates->last_sampled_time = 0; in reset_gpstates()
224 gpstates->last_lpstate_idx = 0; in reset_gpstates()
225 gpstates->last_gpstate_idx = 0; in reset_gpstates()
644 static inline void queue_gpstate_timer(struct global_pstate_info *gpstates) in queue_gpstate_timer() argument
654 if ((gpstates->elapsed_time + GPSTATE_TIMER_INTERVAL) in queue_gpstate_timer()
656 timer_interval = MAX_RAMP_DOWN_TIME - gpstates->elapsed_time; in queue_gpstate_timer()
660 mod_timer(&gpstates->timer, jiffies + msecs_to_jiffies(timer_interval)); in queue_gpstate_timer()
674 struct global_pstate_info *gpstates = from_timer(gpstates, t, timer); in gpstate_timer_handler() local
675 struct cpufreq_policy *policy = gpstates->policy; in gpstate_timer_handler()
679 - gpstates->last_sampled_time; in gpstate_timer_handler()
682 if (!spin_trylock(&gpstates->gpstate_lock)) in gpstate_timer_handler()
689 gpstates->timer.expires = jiffies + msecs_to_jiffies(1); in gpstate_timer_handler()
690 add_timer_on(&gpstates->timer, cpumask_first(policy->cpus)); in gpstate_timer_handler()
691 spin_unlock(&gpstates->gpstate_lock); in gpstate_timer_handler()
705 spin_unlock(&gpstates->gpstate_lock); in gpstate_timer_handler()
709 gpstates->last_sampled_time += time_diff; in gpstate_timer_handler()
710 gpstates->elapsed_time += time_diff; in gpstate_timer_handler()
712 if (gpstates->elapsed_time > MAX_RAMP_DOWN_TIME) { in gpstate_timer_handler()
716 gpstates->highest_lpstate_idx = gpstate_idx; in gpstate_timer_handler()
719 gpstate_idx = calc_global_pstate(gpstates->elapsed_time, in gpstate_timer_handler()
720 gpstates->highest_lpstate_idx, in gpstate_timer_handler()
724 gpstates->last_gpstate_idx = gpstate_idx; in gpstate_timer_handler()
725 gpstates->last_lpstate_idx = lpstate_idx; in gpstate_timer_handler()
730 if (gpstate_idx != gpstates->last_lpstate_idx) in gpstate_timer_handler()
731 queue_gpstate_timer(gpstates); in gpstate_timer_handler()
734 spin_unlock(&gpstates->gpstate_lock); in gpstate_timer_handler()
747 struct global_pstate_info *gpstates = policy->driver_data; in powernv_cpufreq_target_index() local
764 if (!gpstates) { in powernv_cpufreq_target_index()
769 spin_lock(&gpstates->gpstate_lock); in powernv_cpufreq_target_index()
771 if (!gpstates->last_sampled_time) { in powernv_cpufreq_target_index()
773 gpstates->highest_lpstate_idx = new_index; in powernv_cpufreq_target_index()
777 if (gpstates->last_gpstate_idx < new_index) { in powernv_cpufreq_target_index()
778 gpstates->elapsed_time += cur_msec - in powernv_cpufreq_target_index()
779 gpstates->last_sampled_time; in powernv_cpufreq_target_index()
786 if (gpstates->elapsed_time > MAX_RAMP_DOWN_TIME) { in powernv_cpufreq_target_index()
788 gpstates->highest_lpstate_idx = new_index; in powernv_cpufreq_target_index()
792 gpstate_idx = calc_global_pstate(gpstates->elapsed_time, in powernv_cpufreq_target_index()
793 gpstates->highest_lpstate_idx, in powernv_cpufreq_target_index()
798 gpstates->highest_lpstate_idx = new_index; in powernv_cpufreq_target_index()
807 queue_gpstate_timer(gpstates); in powernv_cpufreq_target_index()
809 del_timer_sync(&gpstates->timer); in powernv_cpufreq_target_index()
813 gpstates->last_sampled_time = cur_msec; in powernv_cpufreq_target_index()
814 gpstates->last_gpstate_idx = gpstate_idx; in powernv_cpufreq_target_index()
815 gpstates->last_lpstate_idx = new_index; in powernv_cpufreq_target_index()
817 spin_unlock(&gpstates->gpstate_lock); in powernv_cpufreq_target_index()
833 struct global_pstate_info *gpstates; in powernv_cpufreq_cpu_init() local
861 gpstates = kzalloc(sizeof(*gpstates), GFP_KERNEL); in powernv_cpufreq_cpu_init()
862 if (!gpstates) in powernv_cpufreq_cpu_init()
865 policy->driver_data = gpstates; in powernv_cpufreq_cpu_init()
868 gpstates->policy = policy; in powernv_cpufreq_cpu_init()
869 timer_setup(&gpstates->timer, gpstate_timer_handler, in powernv_cpufreq_cpu_init()
871 gpstates->timer.expires = jiffies + in powernv_cpufreq_cpu_init()
873 spin_lock_init(&gpstates->gpstate_lock); in powernv_cpufreq_cpu_init()
881 struct global_pstate_info *gpstates = policy->driver_data; in powernv_cpufreq_cpu_exit() local
886 if (gpstates) in powernv_cpufreq_cpu_exit()
887 del_timer_sync(&gpstates->timer); in powernv_cpufreq_cpu_exit()