Lines Matching refs:policy
17 struct cpufreq_policy *policy; member
81 if (!cpufreq_this_cpu_can_update(sg_policy->policy)) in sugov_should_update_freq()
126 unsigned long get_capacity_ref_freq(struct cpufreq_policy *policy) in get_capacity_ref_freq() argument
128 unsigned int freq = arch_scale_freq_ref(policy->cpu); in get_capacity_ref_freq()
134 return policy->cpuinfo.max_freq; in get_capacity_ref_freq()
140 return policy->cur + (policy->cur >> 2); in get_capacity_ref_freq()
168 struct cpufreq_policy *policy = sg_policy->policy; in get_next_freq() local
171 freq = get_capacity_ref_freq(policy); in get_next_freq()
178 return cpufreq_driver_resolve_freq(policy, freq); in get_next_freq()
423 if (sg_policy->policy->fast_switch_enabled) { in sugov_update_single_freq()
424 cpufreq_driver_fast_switch(sg_policy->policy, next_f); in sugov_update_single_freq()
466 struct cpufreq_policy *policy = sg_policy->policy; in sugov_next_freq_shared() local
472 for_each_cpu(j, policy->cpus) { in sugov_next_freq_shared()
505 if (sg_policy->policy->fast_switch_enabled) in sugov_update_shared()
506 cpufreq_driver_fast_switch(sg_policy->policy, next_f); in sugov_update_shared()
536 __cpufreq_driver_target(sg_policy->policy, freq, CPUFREQ_RELATION_L); in sugov_work()
634 static struct sugov_policy *sugov_policy_alloc(struct cpufreq_policy *policy) in sugov_policy_alloc() argument
642 sg_policy->policy = policy; in sugov_policy_alloc()
669 struct cpufreq_policy *policy = sg_policy->policy; in sugov_kthread_create() local
673 if (policy->fast_switch_enabled) in sugov_kthread_create()
680 cpumask_first(policy->related_cpus)); in sugov_kthread_create()
694 kthread_bind_mask(thread, policy->related_cpus); in sugov_kthread_create()
706 if (sg_policy->policy->fast_switch_enabled) in sugov_kthread_stop()
733 static int sugov_init(struct cpufreq_policy *policy) in sugov_init() argument
740 if (policy->governor_data) in sugov_init()
743 cpufreq_enable_fast_switch(policy); in sugov_init()
745 sg_policy = sugov_policy_alloc(policy); in sugov_init()
762 policy->governor_data = sg_policy; in sugov_init()
775 tunables->rate_limit_us = cpufreq_policy_transition_delay_us(policy); in sugov_init()
777 policy->governor_data = sg_policy; in sugov_init()
781 get_governor_parent_kobj(policy), "%s", in sugov_init()
794 policy->governor_data = NULL; in sugov_init()
805 cpufreq_disable_fast_switch(policy); in sugov_init()
811 static void sugov_exit(struct cpufreq_policy *policy) in sugov_exit() argument
813 struct sugov_policy *sg_policy = policy->governor_data; in sugov_exit()
820 policy->governor_data = NULL; in sugov_exit()
828 cpufreq_disable_fast_switch(policy); in sugov_exit()
833 static int sugov_start(struct cpufreq_policy *policy) in sugov_start() argument
835 struct sugov_policy *sg_policy = policy->governor_data; in sugov_start()
848 if (policy_is_shared(policy)) in sugov_start()
850 else if (policy->fast_switch_enabled && cpufreq_driver_has_adjust_perf()) in sugov_start()
855 for_each_cpu(cpu, policy->cpus) { in sugov_start()
866 static void sugov_stop(struct cpufreq_policy *policy) in sugov_stop() argument
868 struct sugov_policy *sg_policy = policy->governor_data; in sugov_stop()
871 for_each_cpu(cpu, policy->cpus) in sugov_stop()
876 if (!policy->fast_switch_enabled) { in sugov_stop()
882 static void sugov_limits(struct cpufreq_policy *policy) in sugov_limits() argument
884 struct sugov_policy *sg_policy = policy->governor_data; in sugov_limits()
886 if (!policy->fast_switch_enabled) { in sugov_limits()
888 cpufreq_policy_apply_limits(policy); in sugov_limits()