Lines Matching refs:policy
24 struct cpufreq_policy *policy; member
89 if (sg_policy->policy->fast_switch_enabled && in sugov_should_update_freq()
90 !cpufreq_this_cpu_can_update(sg_policy->policy)) in sugov_should_update_freq()
116 struct cpufreq_policy *policy = sg_policy->policy; in sugov_fast_switch() local
121 next_freq = cpufreq_driver_fast_switch(policy, next_freq); in sugov_fast_switch()
125 policy->cur = next_freq; in sugov_fast_switch()
166 struct cpufreq_policy *policy = sg_policy->policy; in get_next_freq() local
168 policy->cpuinfo.max_freq : policy->cur; in get_next_freq()
177 return cpufreq_driver_resolve_freq(policy, freq); in get_next_freq()
287 ? sg_cpu->sg_policy->policy->min : 0; in sugov_iowait_reset()
334 sg_cpu->iowait_boost = sg_cpu->sg_policy->policy->min; in sugov_iowait_boost()
381 if (sg_cpu->iowait_boost < sg_cpu->sg_policy->policy->min) { in sugov_iowait_apply()
461 if (sg_policy->policy->fast_switch_enabled) { in sugov_update_single()
473 struct cpufreq_policy *policy = sg_policy->policy; in sugov_next_freq_shared() local
477 for_each_cpu(j, policy->cpus) { in sugov_next_freq_shared()
511 if (sg_policy->policy->fast_switch_enabled) in sugov_update_shared()
542 __cpufreq_driver_target(sg_policy->policy, freq, CPUFREQ_RELATION_L); in sugov_work()
606 static struct sugov_policy *sugov_policy_alloc(struct cpufreq_policy *policy) in sugov_policy_alloc() argument
614 sg_policy->policy = policy; in sugov_policy_alloc()
641 struct cpufreq_policy *policy = sg_policy->policy; in sugov_kthread_create() local
645 if (policy->fast_switch_enabled) in sugov_kthread_create()
652 cpumask_first(policy->related_cpus)); in sugov_kthread_create()
666 kthread_bind_mask(thread, policy->related_cpus); in sugov_kthread_create()
678 if (sg_policy->policy->fast_switch_enabled) in sugov_kthread_stop()
707 static int sugov_init(struct cpufreq_policy *policy) in sugov_init() argument
714 if (policy->governor_data) in sugov_init()
717 cpufreq_enable_fast_switch(policy); in sugov_init()
719 sg_policy = sugov_policy_alloc(policy); in sugov_init()
736 policy->governor_data = sg_policy; in sugov_init()
749 tunables->rate_limit_us = cpufreq_policy_transition_delay_us(policy); in sugov_init()
751 policy->governor_data = sg_policy; in sugov_init()
755 get_governor_parent_kobj(policy), "%s", in sugov_init()
765 policy->governor_data = NULL; in sugov_init()
776 cpufreq_disable_fast_switch(policy); in sugov_init()
782 static void sugov_exit(struct cpufreq_policy *policy) in sugov_exit() argument
784 struct sugov_policy *sg_policy = policy->governor_data; in sugov_exit()
791 policy->governor_data = NULL; in sugov_exit()
799 cpufreq_disable_fast_switch(policy); in sugov_exit()
802 static int sugov_start(struct cpufreq_policy *policy) in sugov_start() argument
804 struct sugov_policy *sg_policy = policy->governor_data; in sugov_start()
814 for_each_cpu(cpu, policy->cpus) { in sugov_start()
820 sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq; in sugov_start()
823 for_each_cpu(cpu, policy->cpus) { in sugov_start()
827 policy_is_shared(policy) ? in sugov_start()
834 static void sugov_stop(struct cpufreq_policy *policy) in sugov_stop() argument
836 struct sugov_policy *sg_policy = policy->governor_data; in sugov_stop()
839 for_each_cpu(cpu, policy->cpus) in sugov_stop()
844 if (!policy->fast_switch_enabled) { in sugov_stop()
850 static void sugov_limits(struct cpufreq_policy *policy) in sugov_limits() argument
852 struct sugov_policy *sg_policy = policy->governor_data; in sugov_limits()
854 if (!policy->fast_switch_enabled) { in sugov_limits()
856 cpufreq_policy_apply_limits(policy); in sugov_limits()