Lines Matching refs:pstate

232 	struct pstate_data pstate;  member
287 u64 (*get_val)(struct cpudata*, int pstate);
519 int perf_ctl_max_phys = cpu->pstate.max_pstate_physical; in intel_pstate_hybrid_hwp_adjust()
520 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
523 int scaling = cpu->pstate.scaling; in intel_pstate_hybrid_hwp_adjust()
529 pr_debug("CPU%d: HWP_CAP guaranteed = %d\n", cpu->cpu, cpu->pstate.max_pstate); in intel_pstate_hybrid_hwp_adjust()
530 pr_debug("CPU%d: HWP_CAP highest = %d\n", cpu->cpu, cpu->pstate.turbo_pstate); in intel_pstate_hybrid_hwp_adjust()
540 if (turbo_freq < cpu->pstate.turbo_pstate * scaling) { in intel_pstate_hybrid_hwp_adjust()
541 cpu->pstate.turbo_freq = turbo_freq; in intel_pstate_hybrid_hwp_adjust()
542 scaling = DIV_ROUND_UP(turbo_freq, cpu->pstate.turbo_pstate); in intel_pstate_hybrid_hwp_adjust()
543 cpu->pstate.scaling = scaling; in intel_pstate_hybrid_hwp_adjust()
549 cpu->pstate.max_freq = rounddown(cpu->pstate.max_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
552 cpu->pstate.max_pstate_physical = in intel_pstate_hybrid_hwp_adjust()
556 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
561 cpu->pstate.min_pstate = DIV_ROUND_UP(cpu->pstate.min_freq, scaling); in intel_pstate_hybrid_hwp_adjust()
573 cpu->pstate.max_pstate == cpu->pstate.turbo_pstate); in update_turbo_state()
579 int turbo_pstate = cpu->pstate.turbo_pstate; in min_perf_pct_min()
582 (cpu->pstate.min_pstate * 100 / turbo_pstate) : 0; in min_perf_pct_min()
881 freq = ratio * cpu->pstate.scaling; in show_base_frequency()
882 if (cpu->pstate.scaling != cpu->pstate.perf_ctl_scaling) in show_base_frequency()
883 freq = rounddown(freq, cpu->pstate.perf_ctl_scaling); in show_base_frequency()
903 cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(cap); in __intel_pstate_get_hwp_cap()
904 cpu->pstate.turbo_pstate = HWP_HIGHEST_PERF(cap); in __intel_pstate_get_hwp_cap()
909 int scaling = cpu->pstate.scaling; in intel_pstate_get_hwp_cap()
913 cpu->pstate.max_freq = cpu->pstate.max_pstate * scaling; in intel_pstate_get_hwp_cap()
914 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * scaling; in intel_pstate_get_hwp_cap()
915 if (scaling != cpu->pstate.perf_ctl_scaling) { in intel_pstate_get_hwp_cap()
916 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_get_hwp_cap()
918 cpu->pstate.max_freq = rounddown(cpu->pstate.max_freq, in intel_pstate_get_hwp_cap()
920 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_freq, in intel_pstate_get_hwp_cap()
1103 cpudata->pstate.max_freq : cpudata->pstate.turbo_freq; in intel_pstate_update_max_freq()
1183 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1184 no_turbo = cpu->pstate.max_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1207 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_num_pstates()
1268 int pct = cpu->pstate.max_pstate * 100 / cpu->pstate.turbo_pstate; in store_no_turbo()
1314 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * perf_pct, 100); in update_qos_request()
1584 static u64 atom_get_val(struct cpudata *cpudata, int pstate) in atom_get_val() argument
1590 val = (u64)pstate << 8; in atom_get_val()
1595 int_tofp(pstate - cpudata->pstate.min_pstate), in atom_get_val()
1601 if (pstate > cpudata->pstate.max_pstate) in atom_get_val()
1647 int_tofp(cpudata->pstate.max_pstate - in atom_get_vid()
1648 cpudata->pstate.min_pstate)); in atom_get_vid()
1756 static u64 core_get_val(struct cpudata *cpudata, int pstate) in core_get_val() argument
1760 val = (u64)pstate << 8; in core_get_val()
1817 static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) in intel_pstate_set_pstate() argument
1819 trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_set_pstate()
1820 cpu->pstate.current_pstate = pstate; in intel_pstate_set_pstate()
1827 pstate_funcs.get_val(cpu, pstate)); in intel_pstate_set_pstate()
1832 intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); in intel_pstate_set_min_pstate()
1837 int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); in intel_pstate_max_within_limits() local
1840 intel_pstate_set_pstate(cpu, pstate); in intel_pstate_max_within_limits()
1848 cpu->pstate.min_pstate = pstate_funcs.get_min(); in intel_pstate_get_cpu_pstates()
1849 cpu->pstate.max_pstate_physical = perf_ctl_max_phys; in intel_pstate_get_cpu_pstates()
1850 cpu->pstate.perf_ctl_scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1856 cpu->pstate.scaling = pstate_funcs.get_cpu_scaling(cpu->cpu); in intel_pstate_get_cpu_pstates()
1857 if (cpu->pstate.scaling != perf_ctl_scaling) in intel_pstate_get_cpu_pstates()
1860 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1863 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1864 cpu->pstate.max_pstate = pstate_funcs.get_max(); in intel_pstate_get_cpu_pstates()
1865 cpu->pstate.turbo_pstate = pstate_funcs.get_turbo(); in intel_pstate_get_cpu_pstates()
1868 if (cpu->pstate.scaling == perf_ctl_scaling) { in intel_pstate_get_cpu_pstates()
1869 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1870 cpu->pstate.max_freq = cpu->pstate.max_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1871 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2050 return mul_ext_fp(cpu->pstate.max_pstate_physical, in get_avg_pstate()
2069 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; in get_target_pstate()
2072 if (target < cpu->pstate.min_pstate) in get_target_pstate()
2073 target = cpu->pstate.min_pstate; in get_target_pstate()
2089 static int intel_pstate_prepare_request(struct cpudata *cpu, int pstate) in intel_pstate_prepare_request() argument
2091 int min_pstate = max(cpu->pstate.min_pstate, cpu->min_perf_ratio); in intel_pstate_prepare_request()
2094 return clamp_t(int, pstate, min_pstate, max_pstate); in intel_pstate_prepare_request()
2097 static void intel_pstate_update_pstate(struct cpudata *cpu, int pstate) in intel_pstate_update_pstate() argument
2099 if (pstate == cpu->pstate.current_pstate) in intel_pstate_update_pstate()
2102 cpu->pstate.current_pstate = pstate; in intel_pstate_update_pstate()
2103 wrmsrl(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, pstate)); in intel_pstate_update_pstate()
2108 int from = cpu->pstate.current_pstate; in intel_pstate_adjust_pstate()
2116 trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_adjust_pstate()
2123 cpu->pstate.current_pstate, in intel_pstate_adjust_pstate()
2337 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_get_max_freq()
2344 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_update_perf_limits()
2363 if (cpu->pstate.scaling != perf_ctl_scaling) { in intel_pstate_update_perf_limits()
2364 int scaling = cpu->pstate.scaling; in intel_pstate_update_perf_limits()
2382 int turbo_max = cpu->pstate.turbo_pstate; in intel_pstate_update_perf_limits()
2456 cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate && in intel_pstate_adjust_policy_max()
2458 policy->max > cpu->pstate.max_freq) { in intel_pstate_adjust_policy_max()
2473 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_verify_cpu_policy()
2565 policy->cpuinfo.min_freq = cpu->pstate.min_freq; in __intel_pstate_cpu_init()
2569 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in __intel_pstate_cpu_init()
2657 cpu->pstate.current_pstate, in intel_cpufreq_trace()
2704 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_update_pstate()
2717 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_update_pstate()
2742 target_pstate = DIV_ROUND_UP(freqs.new, cpu->pstate.scaling); in intel_cpufreq_target()
2745 target_pstate = freqs.new / cpu->pstate.scaling; in intel_cpufreq_target()
2748 target_pstate = DIV_ROUND_CLOSEST(freqs.new, cpu->pstate.scaling); in intel_cpufreq_target()
2754 freqs.new = target_pstate * cpu->pstate.scaling; in intel_cpufreq_target()
2769 target_pstate = DIV_ROUND_UP(target_freq, cpu->pstate.scaling); in intel_cpufreq_fast_switch()
2773 return target_pstate * cpu->pstate.scaling; in intel_cpufreq_fast_switch()
2783 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_adjust_perf()
2800 if (min_pstate < cpu->pstate.min_pstate) in intel_cpufreq_adjust_perf()
2801 min_pstate = cpu->pstate.min_pstate; in intel_cpufreq_adjust_perf()
2814 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_adjust_perf()
2860 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.min_perf_pct, 100); in intel_cpufreq_cpu_init()
2869 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.max_perf_pct, 100); in intel_cpufreq_cpu_init()