Lines Matching refs:pstate

235 	struct pstate_data pstate;  member
291 u64 (*get_val)(struct cpudata*, int pstate);
523 int perf_ctl_max_phys = cpu->pstate.max_pstate_physical; in intel_pstate_hybrid_hwp_adjust()
524 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
526 int scaling = cpu->pstate.scaling; in intel_pstate_hybrid_hwp_adjust()
531 pr_debug("CPU%d: HWP_CAP guaranteed = %d\n", cpu->cpu, cpu->pstate.max_pstate); in intel_pstate_hybrid_hwp_adjust()
532 pr_debug("CPU%d: HWP_CAP highest = %d\n", cpu->cpu, cpu->pstate.turbo_pstate); in intel_pstate_hybrid_hwp_adjust()
535 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
537 cpu->pstate.max_freq = rounddown(cpu->pstate.max_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
540 cpu->pstate.max_pstate_physical = in intel_pstate_hybrid_hwp_adjust()
544 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
549 cpu->pstate.min_pstate = DIV_ROUND_UP(cpu->pstate.min_freq, scaling); in intel_pstate_hybrid_hwp_adjust()
561 cpu->pstate.max_pstate == cpu->pstate.turbo_pstate); in update_turbo_state()
567 int turbo_pstate = cpu->pstate.turbo_pstate; in min_perf_pct_min()
570 (cpu->pstate.min_pstate * 100 / turbo_pstate) : 0; in min_perf_pct_min()
879 freq = ratio * cpu->pstate.scaling; in show_base_frequency()
880 if (cpu->pstate.scaling != cpu->pstate.perf_ctl_scaling) in show_base_frequency()
881 freq = rounddown(freq, cpu->pstate.perf_ctl_scaling); in show_base_frequency()
901 cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(cap); in __intel_pstate_get_hwp_cap()
902 cpu->pstate.turbo_pstate = HWP_HIGHEST_PERF(cap); in __intel_pstate_get_hwp_cap()
907 int scaling = cpu->pstate.scaling; in intel_pstate_get_hwp_cap()
911 cpu->pstate.max_freq = cpu->pstate.max_pstate * scaling; in intel_pstate_get_hwp_cap()
912 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * scaling; in intel_pstate_get_hwp_cap()
913 if (scaling != cpu->pstate.perf_ctl_scaling) { in intel_pstate_get_hwp_cap()
914 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_get_hwp_cap()
916 cpu->pstate.max_freq = rounddown(cpu->pstate.max_freq, in intel_pstate_get_hwp_cap()
918 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_freq, in intel_pstate_get_hwp_cap()
1115 cpudata->pstate.max_freq : cpudata->pstate.turbo_freq; in __intel_pstate_update_max_freq()
1204 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1205 no_turbo = cpu->pstate.max_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1228 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_num_pstates()
1289 int pct = cpu->pstate.max_pstate * 100 / cpu->pstate.turbo_pstate; in store_no_turbo()
1336 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * perf_pct, 100); in update_qos_request()
1741 static u64 atom_get_val(struct cpudata *cpudata, int pstate) in atom_get_val() argument
1747 val = (u64)pstate << 8; in atom_get_val()
1752 int_tofp(pstate - cpudata->pstate.min_pstate), in atom_get_val()
1758 if (pstate > cpudata->pstate.max_pstate) in atom_get_val()
1804 int_tofp(cpudata->pstate.max_pstate - in atom_get_vid()
1805 cpudata->pstate.min_pstate)); in atom_get_vid()
1913 static u64 core_get_val(struct cpudata *cpudata, int pstate) in core_get_val() argument
1917 val = (u64)pstate << 8; in core_get_val()
1961 static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) in intel_pstate_set_pstate() argument
1963 trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_set_pstate()
1964 cpu->pstate.current_pstate = pstate; in intel_pstate_set_pstate()
1971 pstate_funcs.get_val(cpu, pstate)); in intel_pstate_set_pstate()
1976 intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); in intel_pstate_set_min_pstate()
1981 int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); in intel_pstate_max_within_limits() local
1984 intel_pstate_set_pstate(cpu, pstate); in intel_pstate_max_within_limits()
1992 cpu->pstate.min_pstate = pstate_funcs.get_min(cpu->cpu); in intel_pstate_get_cpu_pstates()
1993 cpu->pstate.max_pstate_physical = perf_ctl_max_phys; in intel_pstate_get_cpu_pstates()
1994 cpu->pstate.perf_ctl_scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2000 cpu->pstate.scaling = pstate_funcs.get_cpu_scaling(cpu->cpu); in intel_pstate_get_cpu_pstates()
2001 if (cpu->pstate.scaling != perf_ctl_scaling) in intel_pstate_get_cpu_pstates()
2004 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2007 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2008 cpu->pstate.max_pstate = pstate_funcs.get_max(cpu->cpu); in intel_pstate_get_cpu_pstates()
2009 cpu->pstate.turbo_pstate = pstate_funcs.get_turbo(cpu->cpu); in intel_pstate_get_cpu_pstates()
2012 if (cpu->pstate.scaling == perf_ctl_scaling) { in intel_pstate_get_cpu_pstates()
2013 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2014 cpu->pstate.max_freq = cpu->pstate.max_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2015 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2194 return mul_ext_fp(cpu->pstate.max_pstate_physical, in get_avg_pstate()
2213 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; in get_target_pstate()
2216 if (target < cpu->pstate.min_pstate) in get_target_pstate()
2217 target = cpu->pstate.min_pstate; in get_target_pstate()
2233 static int intel_pstate_prepare_request(struct cpudata *cpu, int pstate) in intel_pstate_prepare_request() argument
2235 int min_pstate = max(cpu->pstate.min_pstate, cpu->min_perf_ratio); in intel_pstate_prepare_request()
2238 return clamp_t(int, pstate, min_pstate, max_pstate); in intel_pstate_prepare_request()
2241 static void intel_pstate_update_pstate(struct cpudata *cpu, int pstate) in intel_pstate_update_pstate() argument
2243 if (pstate == cpu->pstate.current_pstate) in intel_pstate_update_pstate()
2246 cpu->pstate.current_pstate = pstate; in intel_pstate_update_pstate()
2247 wrmsrl(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, pstate)); in intel_pstate_update_pstate()
2252 int from = cpu->pstate.current_pstate; in intel_pstate_adjust_pstate()
2260 trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_adjust_pstate()
2267 cpu->pstate.current_pstate, in intel_pstate_adjust_pstate()
2484 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_get_max_freq()
2491 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_update_perf_limits()
2507 if (hwp_active && cpu->pstate.scaling != perf_ctl_scaling) { in intel_pstate_update_perf_limits()
2508 int scaling = cpu->pstate.scaling; in intel_pstate_update_perf_limits()
2525 int turbo_max = cpu->pstate.turbo_pstate; in intel_pstate_update_perf_limits()
2599 cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate && in intel_pstate_adjust_policy_max()
2601 policy->max > cpu->pstate.max_freq) { in intel_pstate_adjust_policy_max()
2616 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_verify_cpu_policy()
2708 policy->cpuinfo.min_freq = cpu->pstate.min_freq; in __intel_pstate_cpu_init()
2712 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in __intel_pstate_cpu_init()
2800 cpu->pstate.current_pstate, in intel_cpufreq_trace()
2847 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_update_pstate()
2860 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_update_pstate()
2885 target_pstate = DIV_ROUND_UP(freqs.new, cpu->pstate.scaling); in intel_cpufreq_target()
2888 target_pstate = freqs.new / cpu->pstate.scaling; in intel_cpufreq_target()
2891 target_pstate = DIV_ROUND_CLOSEST(freqs.new, cpu->pstate.scaling); in intel_cpufreq_target()
2897 freqs.new = target_pstate * cpu->pstate.scaling; in intel_cpufreq_target()
2912 target_pstate = DIV_ROUND_UP(target_freq, cpu->pstate.scaling); in intel_cpufreq_fast_switch()
2916 return target_pstate * cpu->pstate.scaling; in intel_cpufreq_fast_switch()
2926 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_adjust_perf()
2943 if (min_pstate < cpu->pstate.min_pstate) in intel_cpufreq_adjust_perf()
2944 min_pstate = cpu->pstate.min_pstate; in intel_cpufreq_adjust_perf()
2957 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_adjust_perf()
3003 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.min_perf_pct, 100); in intel_cpufreq_cpu_init()
3012 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.max_perf_pct, 100); in intel_cpufreq_cpu_init()