Lines Matching refs:pstate
239 struct pstate_data pstate; member
292 u64 (*get_val)(struct cpudata*, int pstate);
511 cpu->pstate.max_pstate == cpu->pstate.turbo_pstate); in update_turbo_state()
517 int turbo_pstate = cpu->pstate.turbo_pstate; in min_perf_pct_min()
520 (cpu->pstate.min_pstate * 100 / turbo_pstate) : 0; in min_perf_pct_min()
820 return sprintf(buf, "%d\n", ratio * cpu->pstate.scaling); in show_base_frequency()
1025 cpudata->pstate.max_freq : cpudata->pstate.turbo_freq; in intel_pstate_update_max_freq()
1105 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1106 no_turbo = cpu->pstate.max_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1129 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_num_pstates()
1190 int pct = cpu->pstate.max_pstate * 100 / cpu->pstate.turbo_pstate; in store_no_turbo()
1228 turbo_max = cpu->pstate.turbo_pstate; in update_qos_request()
1238 freq *= cpu->pstate.scaling; in update_qos_request()
1497 static u64 atom_get_val(struct cpudata *cpudata, int pstate) in atom_get_val() argument
1503 val = (u64)pstate << 8; in atom_get_val()
1508 int_tofp(pstate - cpudata->pstate.min_pstate), in atom_get_val()
1514 if (pstate > cpudata->pstate.max_pstate) in atom_get_val()
1560 int_tofp(cpudata->pstate.max_pstate - in atom_get_vid()
1561 cpudata->pstate.min_pstate)); in atom_get_vid()
1669 static u64 core_get_val(struct cpudata *cpudata, int pstate) in core_get_val() argument
1673 val = (u64)pstate << 8; in core_get_val()
1698 static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) in intel_pstate_set_pstate() argument
1700 trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_set_pstate()
1701 cpu->pstate.current_pstate = pstate; in intel_pstate_set_pstate()
1708 pstate_funcs.get_val(cpu, pstate)); in intel_pstate_set_pstate()
1713 intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); in intel_pstate_set_min_pstate()
1718 int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); in intel_pstate_max_within_limits() local
1721 intel_pstate_set_pstate(cpu, pstate); in intel_pstate_max_within_limits()
1726 cpu->pstate.min_pstate = pstate_funcs.get_min(); in intel_pstate_get_cpu_pstates()
1727 cpu->pstate.max_pstate_physical = pstate_funcs.get_max_physical(); in intel_pstate_get_cpu_pstates()
1728 cpu->pstate.turbo_pstate = pstate_funcs.get_turbo(); in intel_pstate_get_cpu_pstates()
1729 cpu->pstate.scaling = pstate_funcs.get_scaling(); in intel_pstate_get_cpu_pstates()
1735 cpu->pstate.turbo_freq = phy_max * cpu->pstate.scaling; in intel_pstate_get_cpu_pstates()
1736 cpu->pstate.turbo_pstate = phy_max; in intel_pstate_get_cpu_pstates()
1737 cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(READ_ONCE(cpu->hwp_cap_cached)); in intel_pstate_get_cpu_pstates()
1739 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * cpu->pstate.scaling; in intel_pstate_get_cpu_pstates()
1740 cpu->pstate.max_pstate = pstate_funcs.get_max(); in intel_pstate_get_cpu_pstates()
1742 cpu->pstate.max_freq = cpu->pstate.max_pstate * cpu->pstate.scaling; in intel_pstate_get_cpu_pstates()
1919 return mul_ext_fp(cpu->pstate.max_pstate_physical, in get_avg_pstate()
1938 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; in get_target_pstate()
1941 if (target < cpu->pstate.min_pstate) in get_target_pstate()
1942 target = cpu->pstate.min_pstate; in get_target_pstate()
1958 static int intel_pstate_prepare_request(struct cpudata *cpu, int pstate) in intel_pstate_prepare_request() argument
1960 int min_pstate = max(cpu->pstate.min_pstate, cpu->min_perf_ratio); in intel_pstate_prepare_request()
1963 return clamp_t(int, pstate, min_pstate, max_pstate); in intel_pstate_prepare_request()
1966 static void intel_pstate_update_pstate(struct cpudata *cpu, int pstate) in intel_pstate_update_pstate() argument
1968 if (pstate == cpu->pstate.current_pstate) in intel_pstate_update_pstate()
1971 cpu->pstate.current_pstate = pstate; in intel_pstate_update_pstate()
1972 wrmsrl(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, pstate)); in intel_pstate_update_pstate()
1977 int from = cpu->pstate.current_pstate; in intel_pstate_adjust_pstate()
1985 trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_adjust_pstate()
1992 cpu->pstate.current_pstate, in intel_pstate_adjust_pstate()
2204 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_get_max_freq()
2224 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; in intel_pstate_update_perf_limits()
2225 turbo_max = cpu->pstate.turbo_pstate; in intel_pstate_update_perf_limits()
2227 max_freq = max_state * cpu->pstate.scaling; in intel_pstate_update_perf_limits()
2319 cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate && in intel_pstate_adjust_policy_max()
2321 policy->max > cpu->pstate.max_freq) { in intel_pstate_adjust_policy_max()
2337 max_freq = max_state * cpu->pstate.scaling; in intel_pstate_verify_cpu_policy()
2428 policy->min = cpu->pstate.min_pstate * cpu->pstate.scaling; in __intel_pstate_cpu_init()
2429 policy->max = cpu->pstate.turbo_pstate * cpu->pstate.scaling; in __intel_pstate_cpu_init()
2432 policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling; in __intel_pstate_cpu_init()
2436 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; in __intel_pstate_cpu_init()
2437 policy->cpuinfo.max_freq *= cpu->pstate.scaling; in __intel_pstate_cpu_init()
2443 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in __intel_pstate_cpu_init()
2532 cpu->pstate.current_pstate, in intel_cpufreq_trace()
2580 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_update_pstate()
2586 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_update_pstate()
2589 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_update_pstate()
2615 target_pstate = DIV_ROUND_UP(freqs.new, cpu->pstate.scaling); in intel_cpufreq_target()
2618 target_pstate = freqs.new / cpu->pstate.scaling; in intel_cpufreq_target()
2621 target_pstate = DIV_ROUND_CLOSEST(freqs.new, cpu->pstate.scaling); in intel_cpufreq_target()
2627 freqs.new = target_pstate * cpu->pstate.scaling; in intel_cpufreq_target()
2642 target_pstate = DIV_ROUND_UP(target_freq, cpu->pstate.scaling); in intel_cpufreq_fast_switch()
2646 return target_pstate * cpu->pstate.scaling; in intel_cpufreq_fast_switch()
2685 turbo_max = cpu->pstate.turbo_pstate; in intel_cpufreq_cpu_init()
2690 min_freq *= cpu->pstate.scaling; in intel_cpufreq_cpu_init()
2692 max_freq *= cpu->pstate.scaling; in intel_cpufreq_cpu_init()