Lines Matching full:policy
17 struct cpufreq_policy *policy; member
81 if (!cpufreq_this_cpu_can_update(sg_policy->policy)) in sugov_should_update_freq()
90 * of policy limits in cpufreq_driver_resolve_freq() or a policy in sugov_should_update_freq()
115 * The policy limits have changed, but if the return value of in sugov_update_next_freq()
120 * policy limits. in sugov_update_next_freq()
145 * correlate frequency and compute capacity for a given cpufreq policy. We use
147 * @policy: the cpufreq policy of the CPU in question.
152 unsigned long get_capacity_ref_freq(struct cpufreq_policy *policy) in get_capacity_ref_freq() argument
154 unsigned int freq = arch_scale_freq_ref(policy->cpu); in get_capacity_ref_freq()
160 return policy->cpuinfo.max_freq; in get_capacity_ref_freq()
166 return policy->cur + (policy->cur >> 2); in get_capacity_ref_freq()
170 * get_next_freq - Compute a new frequency for a given cpufreq policy.
171 * @sg_policy: schedutil policy object to compute the new frequency for.
188 * next_freq (as calculated above) is returned, subject to policy min/max and
194 struct cpufreq_policy *policy = sg_policy->policy; in get_next_freq() local
197 freq = get_capacity_ref_freq(policy); in get_next_freq()
204 return cpufreq_driver_resolve_freq(policy, freq); in get_next_freq()
449 if (sg_policy->policy->fast_switch_enabled) { in sugov_update_single_freq()
450 cpufreq_driver_fast_switch(sg_policy->policy, next_f); in sugov_update_single_freq()
492 struct cpufreq_policy *policy = sg_policy->policy; in sugov_next_freq_shared() local
498 for_each_cpu(j, policy->cpus) { in sugov_next_freq_shared()
531 if (sg_policy->policy->fast_switch_enabled) in sugov_update_shared()
532 cpufreq_driver_fast_switch(sg_policy->policy, next_f); in sugov_update_shared()
562 __cpufreq_driver_target(sg_policy->policy, freq, CPUFREQ_RELATION_L); in sugov_work()
635 static struct sugov_policy *sugov_policy_alloc(struct cpufreq_policy *policy) in sugov_policy_alloc() argument
643 sg_policy->policy = policy; in sugov_policy_alloc()
670 struct cpufreq_policy *policy = sg_policy->policy; in sugov_kthread_create() local
674 if (policy->fast_switch_enabled) in sugov_kthread_create()
681 cpumask_first(policy->related_cpus)); in sugov_kthread_create()
695 if (policy->dvfs_possible_from_any_cpu) in sugov_kthread_create()
696 set_cpus_allowed_ptr(thread, policy->related_cpus); in sugov_kthread_create()
698 kthread_bind_mask(thread, policy->related_cpus); in sugov_kthread_create()
711 if (sg_policy->policy->fast_switch_enabled) in sugov_kthread_stop()
738 static int sugov_init(struct cpufreq_policy *policy) in sugov_init() argument
745 if (policy->governor_data) in sugov_init()
748 cpufreq_enable_fast_switch(policy); in sugov_init()
750 sg_policy = sugov_policy_alloc(policy); in sugov_init()
767 policy->governor_data = sg_policy; in sugov_init()
780 tunables->rate_limit_us = cpufreq_policy_transition_delay_us(policy); in sugov_init()
782 policy->governor_data = sg_policy; in sugov_init()
786 get_governor_parent_kobj(policy), "%s", in sugov_init()
802 policy->governor_data = NULL; in sugov_init()
813 cpufreq_disable_fast_switch(policy); in sugov_init()
819 static void sugov_exit(struct cpufreq_policy *policy) in sugov_exit() argument
821 struct sugov_policy *sg_policy = policy->governor_data; in sugov_exit()
828 policy->governor_data = NULL; in sugov_exit()
836 cpufreq_disable_fast_switch(policy); in sugov_exit()
841 static int sugov_start(struct cpufreq_policy *policy) in sugov_start() argument
843 struct sugov_policy *sg_policy = policy->governor_data; in sugov_start()
856 if (policy_is_shared(policy)) in sugov_start()
858 else if (policy->fast_switch_enabled && cpufreq_driver_has_adjust_perf()) in sugov_start()
863 for_each_cpu(cpu, policy->cpus) { in sugov_start()
874 static void sugov_stop(struct cpufreq_policy *policy) in sugov_stop() argument
876 struct sugov_policy *sg_policy = policy->governor_data; in sugov_stop()
879 for_each_cpu(cpu, policy->cpus) in sugov_stop()
884 if (!policy->fast_switch_enabled) { in sugov_stop()
890 static void sugov_limits(struct cpufreq_policy *policy) in sugov_limits() argument
892 struct sugov_policy *sg_policy = policy->governor_data; in sugov_limits()
894 if (!policy->fast_switch_enabled) { in sugov_limits()
896 cpufreq_policy_apply_limits(policy); in sugov_limits()
902 * of policy limits in cpufreq_set_policy() or a policy limits update in sugov_limits()