Lines Matching refs:pstate

234 	struct pstate_data pstate;  member
290 u64 (*get_val)(struct cpudata*, int pstate);
532 int perf_ctl_max_phys = cpu->pstate.max_pstate_physical; in intel_pstate_hybrid_hwp_adjust()
533 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
536 int scaling = cpu->pstate.scaling; in intel_pstate_hybrid_hwp_adjust()
542 pr_debug("CPU%d: HWP_CAP guaranteed = %d\n", cpu->cpu, cpu->pstate.max_pstate); in intel_pstate_hybrid_hwp_adjust()
543 pr_debug("CPU%d: HWP_CAP highest = %d\n", cpu->cpu, cpu->pstate.turbo_pstate); in intel_pstate_hybrid_hwp_adjust()
553 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * scaling; in intel_pstate_hybrid_hwp_adjust()
554 if (turbo_freq < cpu->pstate.turbo_freq) { in intel_pstate_hybrid_hwp_adjust()
555 cpu->pstate.turbo_freq = turbo_freq; in intel_pstate_hybrid_hwp_adjust()
556 scaling = DIV_ROUND_UP(turbo_freq, cpu->pstate.turbo_pstate); in intel_pstate_hybrid_hwp_adjust()
557 cpu->pstate.scaling = scaling; in intel_pstate_hybrid_hwp_adjust()
563 cpu->pstate.max_freq = rounddown(cpu->pstate.max_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
566 cpu->pstate.max_pstate_physical = in intel_pstate_hybrid_hwp_adjust()
570 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
575 cpu->pstate.min_pstate = DIV_ROUND_UP(cpu->pstate.min_freq, scaling); in intel_pstate_hybrid_hwp_adjust()
587 cpu->pstate.max_pstate == cpu->pstate.turbo_pstate); in update_turbo_state()
593 int turbo_pstate = cpu->pstate.turbo_pstate; in min_perf_pct_min()
596 (cpu->pstate.min_pstate * 100 / turbo_pstate) : 0; in min_perf_pct_min()
895 freq = ratio * cpu->pstate.scaling; in show_base_frequency()
896 if (cpu->pstate.scaling != cpu->pstate.perf_ctl_scaling) in show_base_frequency()
897 freq = rounddown(freq, cpu->pstate.perf_ctl_scaling); in show_base_frequency()
917 cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(cap); in __intel_pstate_get_hwp_cap()
918 cpu->pstate.turbo_pstate = HWP_HIGHEST_PERF(cap); in __intel_pstate_get_hwp_cap()
923 int scaling = cpu->pstate.scaling; in intel_pstate_get_hwp_cap()
927 cpu->pstate.max_freq = cpu->pstate.max_pstate * scaling; in intel_pstate_get_hwp_cap()
928 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * scaling; in intel_pstate_get_hwp_cap()
929 if (scaling != cpu->pstate.perf_ctl_scaling) { in intel_pstate_get_hwp_cap()
930 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_get_hwp_cap()
932 cpu->pstate.max_freq = rounddown(cpu->pstate.max_freq, in intel_pstate_get_hwp_cap()
934 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_freq, in intel_pstate_get_hwp_cap()
1137 cpudata->pstate.max_freq : cpudata->pstate.turbo_freq; in intel_pstate_update_max_freq()
1217 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1218 no_turbo = cpu->pstate.max_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1241 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_num_pstates()
1302 int pct = cpu->pstate.max_pstate * 100 / cpu->pstate.turbo_pstate; in store_no_turbo()
1348 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * perf_pct, 100); in update_qos_request()
1712 static u64 atom_get_val(struct cpudata *cpudata, int pstate) in atom_get_val() argument
1718 val = (u64)pstate << 8; in atom_get_val()
1723 int_tofp(pstate - cpudata->pstate.min_pstate), in atom_get_val()
1729 if (pstate > cpudata->pstate.max_pstate) in atom_get_val()
1775 int_tofp(cpudata->pstate.max_pstate - in atom_get_vid()
1776 cpudata->pstate.min_pstate)); in atom_get_vid()
1884 static u64 core_get_val(struct cpudata *cpudata, int pstate) in core_get_val() argument
1888 val = (u64)pstate << 8; in core_get_val()
1945 static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) in intel_pstate_set_pstate() argument
1947 trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_set_pstate()
1948 cpu->pstate.current_pstate = pstate; in intel_pstate_set_pstate()
1955 pstate_funcs.get_val(cpu, pstate)); in intel_pstate_set_pstate()
1960 intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); in intel_pstate_set_min_pstate()
1965 int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); in intel_pstate_max_within_limits() local
1968 intel_pstate_set_pstate(cpu, pstate); in intel_pstate_max_within_limits()
1976 cpu->pstate.min_pstate = pstate_funcs.get_min(); in intel_pstate_get_cpu_pstates()
1977 cpu->pstate.max_pstate_physical = perf_ctl_max_phys; in intel_pstate_get_cpu_pstates()
1978 cpu->pstate.perf_ctl_scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1984 cpu->pstate.scaling = pstate_funcs.get_cpu_scaling(cpu->cpu); in intel_pstate_get_cpu_pstates()
1985 if (cpu->pstate.scaling != perf_ctl_scaling) in intel_pstate_get_cpu_pstates()
1988 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1991 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1992 cpu->pstate.max_pstate = pstate_funcs.get_max(); in intel_pstate_get_cpu_pstates()
1993 cpu->pstate.turbo_pstate = pstate_funcs.get_turbo(); in intel_pstate_get_cpu_pstates()
1996 if (cpu->pstate.scaling == perf_ctl_scaling) { in intel_pstate_get_cpu_pstates()
1997 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1998 cpu->pstate.max_freq = cpu->pstate.max_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1999 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2178 return mul_ext_fp(cpu->pstate.max_pstate_physical, in get_avg_pstate()
2197 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; in get_target_pstate()
2200 if (target < cpu->pstate.min_pstate) in get_target_pstate()
2201 target = cpu->pstate.min_pstate; in get_target_pstate()
2217 static int intel_pstate_prepare_request(struct cpudata *cpu, int pstate) in intel_pstate_prepare_request() argument
2219 int min_pstate = max(cpu->pstate.min_pstate, cpu->min_perf_ratio); in intel_pstate_prepare_request()
2222 return clamp_t(int, pstate, min_pstate, max_pstate); in intel_pstate_prepare_request()
2225 static void intel_pstate_update_pstate(struct cpudata *cpu, int pstate) in intel_pstate_update_pstate() argument
2227 if (pstate == cpu->pstate.current_pstate) in intel_pstate_update_pstate()
2230 cpu->pstate.current_pstate = pstate; in intel_pstate_update_pstate()
2231 wrmsrl(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, pstate)); in intel_pstate_update_pstate()
2236 int from = cpu->pstate.current_pstate; in intel_pstate_adjust_pstate()
2244 trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_adjust_pstate()
2251 cpu->pstate.current_pstate, in intel_pstate_adjust_pstate()
2466 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_get_max_freq()
2473 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_update_perf_limits()
2492 if (cpu->pstate.scaling != perf_ctl_scaling) { in intel_pstate_update_perf_limits()
2493 int scaling = cpu->pstate.scaling; in intel_pstate_update_perf_limits()
2511 int turbo_max = cpu->pstate.turbo_pstate; in intel_pstate_update_perf_limits()
2585 cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate && in intel_pstate_adjust_policy_max()
2587 policy->max > cpu->pstate.max_freq) { in intel_pstate_adjust_policy_max()
2602 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_verify_cpu_policy()
2694 policy->cpuinfo.min_freq = cpu->pstate.min_freq; in __intel_pstate_cpu_init()
2698 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in __intel_pstate_cpu_init()
2786 cpu->pstate.current_pstate, in intel_cpufreq_trace()
2833 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_update_pstate()
2846 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_update_pstate()
2871 target_pstate = DIV_ROUND_UP(freqs.new, cpu->pstate.scaling); in intel_cpufreq_target()
2874 target_pstate = freqs.new / cpu->pstate.scaling; in intel_cpufreq_target()
2877 target_pstate = DIV_ROUND_CLOSEST(freqs.new, cpu->pstate.scaling); in intel_cpufreq_target()
2883 freqs.new = target_pstate * cpu->pstate.scaling; in intel_cpufreq_target()
2898 target_pstate = DIV_ROUND_UP(target_freq, cpu->pstate.scaling); in intel_cpufreq_fast_switch()
2902 return target_pstate * cpu->pstate.scaling; in intel_cpufreq_fast_switch()
2912 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_adjust_perf()
2929 if (min_pstate < cpu->pstate.min_pstate) in intel_cpufreq_adjust_perf()
2930 min_pstate = cpu->pstate.min_pstate; in intel_cpufreq_adjust_perf()
2943 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_adjust_perf()
2989 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.min_perf_pct, 100); in intel_cpufreq_cpu_init()
2998 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.max_perf_pct, 100); in intel_cpufreq_cpu_init()