Lines Matching refs:policy

19 	struct cpufreq_policy	*policy;  member
83 if (!cpufreq_this_cpu_can_update(sg_policy->policy)) in sugov_should_update_freq()
154 unsigned long get_capacity_ref_freq(struct cpufreq_policy *policy) in get_capacity_ref_freq() argument
156 unsigned int freq = arch_scale_freq_ref(policy->cpu); in get_capacity_ref_freq()
162 return policy->cpuinfo.max_freq; in get_capacity_ref_freq()
168 return policy->cur + (policy->cur >> 2); in get_capacity_ref_freq()
196 struct cpufreq_policy *policy = sg_policy->policy; in get_next_freq() local
199 freq = get_capacity_ref_freq(policy); in get_next_freq()
206 return cpufreq_driver_resolve_freq(policy, freq); in get_next_freq()
451 if (sg_policy->policy->fast_switch_enabled) { in sugov_update_single_freq()
452 cpufreq_driver_fast_switch(sg_policy->policy, next_f); in sugov_update_single_freq()
494 struct cpufreq_policy *policy = sg_policy->policy; in sugov_next_freq_shared() local
500 for_each_cpu(j, policy->cpus) { in sugov_next_freq_shared()
533 if (sg_policy->policy->fast_switch_enabled) in sugov_update_shared()
534 cpufreq_driver_fast_switch(sg_policy->policy, next_f); in sugov_update_shared()
564 __cpufreq_driver_target(sg_policy->policy, freq, CPUFREQ_RELATION_L); in sugov_work()
637 static struct sugov_policy *sugov_policy_alloc(struct cpufreq_policy *policy) in sugov_policy_alloc() argument
645 sg_policy->policy = policy; in sugov_policy_alloc()
672 struct cpufreq_policy *policy = sg_policy->policy; in sugov_kthread_create() local
676 if (policy->fast_switch_enabled) in sugov_kthread_create()
683 cpumask_first(policy->related_cpus)); in sugov_kthread_create()
697 if (policy->dvfs_possible_from_any_cpu) in sugov_kthread_create()
698 set_cpus_allowed_ptr(thread, policy->related_cpus); in sugov_kthread_create()
700 kthread_bind_mask(thread, policy->related_cpus); in sugov_kthread_create()
713 if (sg_policy->policy->fast_switch_enabled) in sugov_kthread_stop()
740 static int sugov_init(struct cpufreq_policy *policy) in sugov_init() argument
747 if (policy->governor_data) in sugov_init()
750 cpufreq_enable_fast_switch(policy); in sugov_init()
752 sg_policy = sugov_policy_alloc(policy); in sugov_init()
769 policy->governor_data = sg_policy; in sugov_init()
782 tunables->rate_limit_us = cpufreq_policy_transition_delay_us(policy); in sugov_init()
784 policy->governor_data = sg_policy; in sugov_init()
788 get_governor_parent_kobj(policy), "%s", in sugov_init()
804 policy->governor_data = NULL; in sugov_init()
815 cpufreq_disable_fast_switch(policy); in sugov_init()
821 static void sugov_exit(struct cpufreq_policy *policy) in sugov_exit() argument
823 struct sugov_policy *sg_policy = policy->governor_data; in sugov_exit()
830 policy->governor_data = NULL; in sugov_exit()
838 cpufreq_disable_fast_switch(policy); in sugov_exit()
843 static int sugov_start(struct cpufreq_policy *policy) in sugov_start() argument
845 struct sugov_policy *sg_policy = policy->governor_data; in sugov_start()
858 if (policy_is_shared(policy)) in sugov_start()
860 else if (policy->fast_switch_enabled && cpufreq_driver_has_adjust_perf()) in sugov_start()
865 for_each_cpu(cpu, policy->cpus) { in sugov_start()
876 static void sugov_stop(struct cpufreq_policy *policy) in sugov_stop() argument
878 struct sugov_policy *sg_policy = policy->governor_data; in sugov_stop()
881 for_each_cpu(cpu, policy->cpus) in sugov_stop()
886 if (!policy->fast_switch_enabled) { in sugov_stop()
892 static void sugov_limits(struct cpufreq_policy *policy) in sugov_limits() argument
894 struct sugov_policy *sg_policy = policy->governor_data; in sugov_limits()
896 if (!policy->fast_switch_enabled) { in sugov_limits()
898 cpufreq_policy_apply_limits(policy); in sugov_limits()
932 bool sugov_is_governor(struct cpufreq_policy *policy) in sugov_is_governor() argument
934 return policy->governor == &schedutil_gov; in sugov_is_governor()