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()
112 * The policy limits have changed, but if the return value of in sugov_update_next_freq()
117 * policy limits. in sugov_update_next_freq()
142 * correlate frequency and compute capacity for a given cpufreq policy. We use
144 * @policy: the cpufreq policy of the CPU in question.
149 unsigned long get_capacity_ref_freq(struct cpufreq_policy *policy) in get_capacity_ref_freq() argument
151 unsigned int freq = arch_scale_freq_ref(policy->cpu); in get_capacity_ref_freq()
157 return policy->cpuinfo.max_freq; in get_capacity_ref_freq()
163 return policy->cur + (policy->cur >> 2); in get_capacity_ref_freq()
167 * get_next_freq - Compute a new frequency for a given cpufreq policy.
168 * @sg_policy: schedutil policy object to compute the new frequency for.
185 * next_freq (as calculated above) is returned, subject to policy min/max and
191 struct cpufreq_policy *policy = sg_policy->policy; in get_next_freq() local
194 freq = get_capacity_ref_freq(policy); in get_next_freq()
201 return cpufreq_driver_resolve_freq(policy, freq); in get_next_freq()
446 if (sg_policy->policy->fast_switch_enabled) { in sugov_update_single_freq()
447 cpufreq_driver_fast_switch(sg_policy->policy, next_f); in sugov_update_single_freq()
489 struct cpufreq_policy *policy = sg_policy->policy; in sugov_next_freq_shared() local
495 for_each_cpu(j, policy->cpus) { in sugov_next_freq_shared()
528 if (sg_policy->policy->fast_switch_enabled) in sugov_update_shared()
529 cpufreq_driver_fast_switch(sg_policy->policy, next_f); in sugov_update_shared()
559 __cpufreq_driver_target(sg_policy->policy, freq, CPUFREQ_RELATION_L); in sugov_work()
632 static struct sugov_policy *sugov_policy_alloc(struct cpufreq_policy *policy) in sugov_policy_alloc() argument
640 sg_policy->policy = policy; in sugov_policy_alloc()
667 struct cpufreq_policy *policy = sg_policy->policy; in sugov_kthread_create() local
671 if (policy->fast_switch_enabled) in sugov_kthread_create()
678 cpumask_first(policy->related_cpus)); in sugov_kthread_create()
692 if (policy->dvfs_possible_from_any_cpu) in sugov_kthread_create()
693 set_cpus_allowed_ptr(thread, policy->related_cpus); in sugov_kthread_create()
695 kthread_bind_mask(thread, policy->related_cpus); in sugov_kthread_create()
708 if (sg_policy->policy->fast_switch_enabled) in sugov_kthread_stop()
735 static int sugov_init(struct cpufreq_policy *policy) in sugov_init() argument
742 if (policy->governor_data) in sugov_init()
745 cpufreq_enable_fast_switch(policy); in sugov_init()
747 sg_policy = sugov_policy_alloc(policy); in sugov_init()
764 policy->governor_data = sg_policy; in sugov_init()
777 tunables->rate_limit_us = cpufreq_policy_transition_delay_us(policy); in sugov_init()
779 policy->governor_data = sg_policy; in sugov_init()
783 get_governor_parent_kobj(policy), "%s", in sugov_init()
799 policy->governor_data = NULL; in sugov_init()
810 cpufreq_disable_fast_switch(policy); in sugov_init()
816 static void sugov_exit(struct cpufreq_policy *policy) in sugov_exit() argument
818 struct sugov_policy *sg_policy = policy->governor_data; in sugov_exit()
825 policy->governor_data = NULL; in sugov_exit()
833 cpufreq_disable_fast_switch(policy); in sugov_exit()
838 static int sugov_start(struct cpufreq_policy *policy) in sugov_start() argument
840 struct sugov_policy *sg_policy = policy->governor_data; in sugov_start()
853 if (policy_is_shared(policy)) in sugov_start()
855 else if (policy->fast_switch_enabled && cpufreq_driver_has_adjust_perf()) in sugov_start()
860 for_each_cpu(cpu, policy->cpus) { in sugov_start()
871 static void sugov_stop(struct cpufreq_policy *policy) in sugov_stop() argument
873 struct sugov_policy *sg_policy = policy->governor_data; in sugov_stop()
876 for_each_cpu(cpu, policy->cpus) in sugov_stop()
881 if (!policy->fast_switch_enabled) { in sugov_stop()
887 static void sugov_limits(struct cpufreq_policy *policy) in sugov_limits() argument
889 struct sugov_policy *sg_policy = policy->governor_data; in sugov_limits()
891 if (!policy->fast_switch_enabled) { in sugov_limits()
893 cpufreq_policy_apply_limits(policy); in sugov_limits()
899 * of policy limits in cpufreq_set_policy() or a policy limits update in sugov_limits()