Lines Matching refs:policy

220 	if (epp > 0 && cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) {  in amd_pstate_set_energy_pref_index()
466 static int amd_pstate_verify(struct cpufreq_policy_data *policy) in amd_pstate_verify() argument
468 cpufreq_verify_within_cpu_limits(policy); in amd_pstate_verify()
473 static int amd_pstate_update_freq(struct cpufreq_policy *policy, in amd_pstate_update_freq() argument
477 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_update_freq()
487 freqs.old = policy->cur; in amd_pstate_update_freq()
493 WARN_ON(fast_switch && !policy->fast_switch_enabled); in amd_pstate_update_freq()
500 cpufreq_freq_transition_begin(policy, &freqs); in amd_pstate_update_freq()
503 max_perf, fast_switch, policy->governor->flags); in amd_pstate_update_freq()
506 cpufreq_freq_transition_end(policy, &freqs, false); in amd_pstate_update_freq()
511 static int amd_pstate_target(struct cpufreq_policy *policy, in amd_pstate_target() argument
515 return amd_pstate_update_freq(policy, target_freq, false); in amd_pstate_target()
518 static unsigned int amd_pstate_fast_switch(struct cpufreq_policy *policy, in amd_pstate_fast_switch() argument
521 return amd_pstate_update_freq(policy, target_freq, true); in amd_pstate_fast_switch()
531 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); in amd_pstate_adjust_perf() local
532 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_adjust_perf()
556 policy->cur = target_freq; in amd_pstate_adjust_perf()
559 policy->governor->flags); in amd_pstate_adjust_perf()
560 cpufreq_cpu_put(policy); in amd_pstate_adjust_perf()
635 static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state) in amd_pstate_set_boost() argument
637 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_set_boost()
646 policy->cpuinfo.max_freq = cpudata->max_freq; in amd_pstate_set_boost()
648 policy->cpuinfo.max_freq = cpudata->nominal_freq; in amd_pstate_set_boost()
650 policy->max = policy->cpuinfo.max_freq; in amd_pstate_set_boost()
653 policy->cpuinfo.max_freq); in amd_pstate_set_boost()
679 static int amd_pstate_cpu_init(struct cpufreq_policy *policy) in amd_pstate_cpu_init() argument
689 amd_perf_ctl_reset(policy->cpu); in amd_pstate_cpu_init()
690 dev = get_cpu_device(policy->cpu); in amd_pstate_cpu_init()
698 cpudata->cpu = policy->cpu; in amd_pstate_cpu_init()
716 policy->cpuinfo.transition_latency = AMD_PSTATE_TRANSITION_LATENCY; in amd_pstate_cpu_init()
717 policy->transition_delay_us = AMD_PSTATE_TRANSITION_DELAY; in amd_pstate_cpu_init()
719 policy->min = min_freq; in amd_pstate_cpu_init()
720 policy->max = max_freq; in amd_pstate_cpu_init()
722 policy->cpuinfo.min_freq = min_freq; in amd_pstate_cpu_init()
723 policy->cpuinfo.max_freq = max_freq; in amd_pstate_cpu_init()
726 policy->cur = policy->cpuinfo.min_freq; in amd_pstate_cpu_init()
729 policy->fast_switch_possible = true; in amd_pstate_cpu_init()
731 ret = freq_qos_add_request(&policy->constraints, &cpudata->req[0], in amd_pstate_cpu_init()
732 FREQ_QOS_MIN, policy->cpuinfo.min_freq); in amd_pstate_cpu_init()
738 ret = freq_qos_add_request(&policy->constraints, &cpudata->req[1], in amd_pstate_cpu_init()
739 FREQ_QOS_MAX, policy->cpuinfo.max_freq); in amd_pstate_cpu_init()
751 policy->driver_data = cpudata; in amd_pstate_cpu_init()
766 static int amd_pstate_cpu_exit(struct cpufreq_policy *policy) in amd_pstate_cpu_exit() argument
768 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_cpu_exit()
772 policy->fast_switch_possible = false; in amd_pstate_cpu_exit()
778 static int amd_pstate_cpu_resume(struct cpufreq_policy *policy) in amd_pstate_cpu_resume() argument
789 static int amd_pstate_cpu_suspend(struct cpufreq_policy *policy) in amd_pstate_cpu_suspend() argument
807 static ssize_t show_amd_pstate_max_freq(struct cpufreq_policy *policy, in show_amd_pstate_max_freq() argument
811 struct amd_cpudata *cpudata = policy->driver_data; in show_amd_pstate_max_freq()
820 static ssize_t show_amd_pstate_lowest_nonlinear_freq(struct cpufreq_policy *policy, in show_amd_pstate_lowest_nonlinear_freq() argument
824 struct amd_cpudata *cpudata = policy->driver_data; in show_amd_pstate_lowest_nonlinear_freq()
837 static ssize_t show_amd_pstate_highest_perf(struct cpufreq_policy *policy, in show_amd_pstate_highest_perf() argument
841 struct amd_cpudata *cpudata = policy->driver_data; in show_amd_pstate_highest_perf()
849 struct cpufreq_policy *policy, char *buf) in show_energy_performance_available_preferences() argument
863 struct cpufreq_policy *policy, const char *buf, size_t count) in store_energy_performance_preference() argument
865 struct amd_cpudata *cpudata = policy->driver_data; in store_energy_performance_preference()
885 struct cpufreq_policy *policy, char *buf) in show_energy_performance_preference() argument
887 struct amd_cpudata *cpudata = policy->driver_data; in show_energy_performance_preference()
1094 static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy) in amd_pstate_epp_cpu_init() argument
1105 amd_perf_ctl_reset(policy->cpu); in amd_pstate_epp_cpu_init()
1106 dev = get_cpu_device(policy->cpu); in amd_pstate_epp_cpu_init()
1114 cpudata->cpu = policy->cpu; in amd_pstate_epp_cpu_init()
1132 policy->cpuinfo.min_freq = min_freq; in amd_pstate_epp_cpu_init()
1133 policy->cpuinfo.max_freq = max_freq; in amd_pstate_epp_cpu_init()
1135 policy->cur = policy->cpuinfo.min_freq; in amd_pstate_epp_cpu_init()
1143 policy->driver_data = cpudata; in amd_pstate_epp_cpu_init()
1147 policy->min = policy->cpuinfo.min_freq; in amd_pstate_epp_cpu_init()
1148 policy->max = policy->cpuinfo.max_freq; in amd_pstate_epp_cpu_init()
1156 policy->policy = CPUFREQ_POLICY_PERFORMANCE; in amd_pstate_epp_cpu_init()
1158 policy->policy = CPUFREQ_POLICY_POWERSAVE; in amd_pstate_epp_cpu_init()
1180 static int amd_pstate_epp_cpu_exit(struct cpufreq_policy *policy) in amd_pstate_epp_cpu_exit() argument
1182 pr_debug("CPU %d exiting\n", policy->cpu); in amd_pstate_epp_cpu_exit()
1188 struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); in amd_pstate_epp_init() local
1189 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_epp_init()
1199 if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) in amd_pstate_epp_init()
1213 if (cpudata->epp_policy == cpudata->policy) in amd_pstate_epp_init()
1216 cpudata->epp_policy = cpudata->policy; in amd_pstate_epp_init()
1228 if (cpudata->policy == CPUFREQ_POLICY_PERFORMANCE) in amd_pstate_epp_init()
1240 cpufreq_cpu_put(policy); in amd_pstate_epp_init()
1243 static int amd_pstate_epp_set_policy(struct cpufreq_policy *policy) in amd_pstate_epp_set_policy() argument
1245 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_epp_set_policy()
1247 if (!policy->cpuinfo.max_freq) in amd_pstate_epp_set_policy()
1251 policy->cpuinfo.max_freq, policy->max); in amd_pstate_epp_set_policy()
1253 cpudata->policy = policy->policy; in amd_pstate_epp_set_policy()
1255 amd_pstate_epp_init(policy->cpu); in amd_pstate_epp_set_policy()
1282 static int amd_pstate_epp_cpu_online(struct cpufreq_policy *policy) in amd_pstate_epp_cpu_online() argument
1284 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_epp_cpu_online()
1296 static void amd_pstate_epp_offline(struct cpufreq_policy *policy) in amd_pstate_epp_offline() argument
1298 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_epp_offline()
1325 static int amd_pstate_epp_cpu_offline(struct cpufreq_policy *policy) in amd_pstate_epp_cpu_offline() argument
1327 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_epp_cpu_offline()
1335 amd_pstate_epp_offline(policy); in amd_pstate_epp_cpu_offline()
1340 static int amd_pstate_epp_verify_policy(struct cpufreq_policy_data *policy) in amd_pstate_epp_verify_policy() argument
1342 cpufreq_verify_within_cpu_limits(policy); in amd_pstate_epp_verify_policy()
1343 pr_debug("policy_max =%d, policy_min=%d\n", policy->max, policy->min); in amd_pstate_epp_verify_policy()
1347 static int amd_pstate_epp_suspend(struct cpufreq_policy *policy) in amd_pstate_epp_suspend() argument
1349 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_epp_suspend()
1367 static int amd_pstate_epp_resume(struct cpufreq_policy *policy) in amd_pstate_epp_resume() argument
1369 struct amd_cpudata *cpudata = policy->driver_data; in amd_pstate_epp_resume()