Lines Matching refs:pstate

236 	struct pstate_data pstate;  member
295 u64 (*get_val)(struct cpudata*, int pstate);
538 if (freq == cpu->pstate.turbo_freq) in intel_pstate_freq_to_hwp_rel()
539 return cpu->pstate.turbo_pstate; in intel_pstate_freq_to_hwp_rel()
541 if (freq == cpu->pstate.max_freq) in intel_pstate_freq_to_hwp_rel()
542 return cpu->pstate.max_pstate; in intel_pstate_freq_to_hwp_rel()
546 return freq / cpu->pstate.scaling; in intel_pstate_freq_to_hwp_rel()
548 return DIV_ROUND_CLOSEST(freq, cpu->pstate.scaling); in intel_pstate_freq_to_hwp_rel()
551 return DIV_ROUND_UP(freq, cpu->pstate.scaling); in intel_pstate_freq_to_hwp_rel()
572 int perf_ctl_max_phys = cpu->pstate.max_pstate_physical; in intel_pstate_hybrid_hwp_adjust()
573 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
575 int scaling = cpu->pstate.scaling; in intel_pstate_hybrid_hwp_adjust()
581 pr_debug("CPU%d: HWP_CAP guaranteed = %d\n", cpu->cpu, cpu->pstate.max_pstate); in intel_pstate_hybrid_hwp_adjust()
582 pr_debug("CPU%d: HWP_CAP highest = %d\n", cpu->cpu, cpu->pstate.turbo_pstate); in intel_pstate_hybrid_hwp_adjust()
585 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
587 cpu->pstate.max_freq = rounddown(cpu->pstate.max_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
591 cpu->pstate.max_pstate_physical = intel_pstate_freq_to_hwp(cpu, freq); in intel_pstate_hybrid_hwp_adjust()
593 freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
594 cpu->pstate.min_freq = freq; in intel_pstate_hybrid_hwp_adjust()
599 cpu->pstate.min_pstate = intel_pstate_freq_to_hwp(cpu, freq); in intel_pstate_hybrid_hwp_adjust()
617 int turbo_pstate = cpu->pstate.turbo_pstate; in min_perf_pct_min()
620 (cpu->pstate.min_pstate * 100 / turbo_pstate) : 0; in min_perf_pct_min()
931 freq = ratio * cpu->pstate.scaling; in show_base_frequency()
932 if (cpu->pstate.scaling != cpu->pstate.perf_ctl_scaling) in show_base_frequency()
933 freq = rounddown(freq, cpu->pstate.perf_ctl_scaling); in show_base_frequency()
984 struct pstate_data *pstate = &all_cpu_data[dev->id]->pstate; in hybrid_get_cost() local
997 *cost = div_u64(100ULL * INTEL_PSTATE_CORE_SCALING, pstate->scaling) + freq; in hybrid_get_cost()
1070 cpu->pstate.max_pstate_physical); in hybrid_set_cpu_capacity()
1077 cpu->pstate.max_pstate_physical); in hybrid_set_cpu_capacity()
1088 cpu->capacity_perf = cpu->pstate.max_pstate_physical; in hybrid_get_capacity_perf()
1218 cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(cap); in __intel_pstate_get_hwp_cap()
1219 cpu->pstate.turbo_pstate = HWP_HIGHEST_PERF(cap); in __intel_pstate_get_hwp_cap()
1224 int scaling = cpu->pstate.scaling; in intel_pstate_get_hwp_cap()
1228 cpu->pstate.max_freq = cpu->pstate.max_pstate * scaling; in intel_pstate_get_hwp_cap()
1229 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * scaling; in intel_pstate_get_hwp_cap()
1230 if (scaling != cpu->pstate.perf_ctl_scaling) { in intel_pstate_get_hwp_cap()
1231 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_get_hwp_cap()
1233 cpu->pstate.max_freq = rounddown(cpu->pstate.max_freq, in intel_pstate_get_hwp_cap()
1235 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_freq, in intel_pstate_get_hwp_cap()
1498 cpudata->pstate.max_freq : cpudata->pstate.turbo_freq; in __intel_pstate_update_max_freq()
1592 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1593 no_turbo = cpu->pstate.max_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1616 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_num_pstates()
1680 int pct = cpu->pstate.max_pstate * 100 / cpu->pstate.turbo_pstate; in store_no_turbo()
1728 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * perf_pct, 100); in update_qos_request()
2135 static u64 atom_get_val(struct cpudata *cpudata, int pstate) in atom_get_val() argument
2141 val = (u64)pstate << 8; in atom_get_val()
2146 int_tofp(pstate - cpudata->pstate.min_pstate), in atom_get_val()
2152 if (pstate > cpudata->pstate.max_pstate) in atom_get_val()
2198 int_tofp(cpudata->pstate.max_pstate - in atom_get_vid()
2199 cpudata->pstate.min_pstate)); in atom_get_vid()
2302 static u64 core_get_val(struct cpudata *cpudata, int pstate) in core_get_val() argument
2306 val = (u64)pstate << 8; in core_get_val()
2360 static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) in intel_pstate_set_pstate() argument
2362 trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_set_pstate()
2363 cpu->pstate.current_pstate = pstate; in intel_pstate_set_pstate()
2370 pstate_funcs.get_val(cpu, pstate)); in intel_pstate_set_pstate()
2375 intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); in intel_pstate_set_min_pstate()
2383 cpu->pstate.min_pstate = pstate_funcs.get_min(cpu->cpu); in intel_pstate_get_cpu_pstates()
2384 cpu->pstate.max_pstate_physical = perf_ctl_max_phys; in intel_pstate_get_cpu_pstates()
2385 cpu->pstate.perf_ctl_scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2391 cpu->pstate.scaling = pstate_funcs.get_cpu_scaling(cpu->cpu); in intel_pstate_get_cpu_pstates()
2392 if (cpu->pstate.scaling != perf_ctl_scaling) { in intel_pstate_get_cpu_pstates()
2397 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2405 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2406 cpu->pstate.max_pstate = pstate_funcs.get_max(cpu->cpu); in intel_pstate_get_cpu_pstates()
2407 cpu->pstate.turbo_pstate = pstate_funcs.get_turbo(cpu->cpu); in intel_pstate_get_cpu_pstates()
2410 if (cpu->pstate.scaling == perf_ctl_scaling) { in intel_pstate_get_cpu_pstates()
2411 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2412 cpu->pstate.max_freq = cpu->pstate.max_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2413 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2592 return mul_ext_fp(cpu->pstate.max_pstate_physical, in get_avg_pstate()
2611 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; in get_target_pstate()
2614 if (target < cpu->pstate.min_pstate) in get_target_pstate()
2615 target = cpu->pstate.min_pstate; in get_target_pstate()
2631 static int intel_pstate_prepare_request(struct cpudata *cpu, int pstate) in intel_pstate_prepare_request() argument
2633 int min_pstate = max(cpu->pstate.min_pstate, cpu->min_perf_ratio); in intel_pstate_prepare_request()
2636 return clamp_t(int, pstate, min_pstate, max_pstate); in intel_pstate_prepare_request()
2639 static void intel_pstate_update_pstate(struct cpudata *cpu, int pstate) in intel_pstate_update_pstate() argument
2641 if (pstate == cpu->pstate.current_pstate) in intel_pstate_update_pstate()
2644 cpu->pstate.current_pstate = pstate; in intel_pstate_update_pstate()
2645 wrmsrq(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, pstate)); in intel_pstate_update_pstate()
2650 int from = cpu->pstate.current_pstate; in intel_pstate_adjust_pstate()
2656 trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_adjust_pstate()
2663 cpu->pstate.current_pstate, in intel_pstate_adjust_pstate()
2882 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_get_max_freq()
2889 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_update_perf_limits()
2905 if (hwp_active && cpu->pstate.scaling != perf_ctl_scaling) { in intel_pstate_update_perf_limits()
2922 int turbo_max = cpu->pstate.turbo_pstate; in intel_pstate_update_perf_limits()
2966 int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); in intel_pstate_set_policy() local
2973 intel_pstate_set_pstate(cpu, pstate); in intel_pstate_set_policy()
3003 cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate && in intel_pstate_adjust_policy_max()
3005 policy->max > cpu->pstate.max_freq) { in intel_pstate_adjust_policy_max()
3019 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_verify_cpu_policy()
3111 policy->cpuinfo.min_freq = cpu->pstate.min_freq; in __intel_pstate_cpu_init()
3113 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in __intel_pstate_cpu_init()
3201 cpu->pstate.current_pstate, in intel_cpufreq_trace()
3248 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_update_pstate()
3261 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_update_pstate()
3285 freqs.new = target_pstate * cpu->pstate.scaling; in intel_cpufreq_target()
3302 return target_pstate * cpu->pstate.scaling; in intel_cpufreq_fast_switch()
3312 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_adjust_perf()
3329 if (min_pstate < cpu->pstate.min_pstate) in intel_cpufreq_adjust_perf()
3330 min_pstate = cpu->pstate.min_pstate; in intel_cpufreq_adjust_perf()
3346 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_adjust_perf()
3392 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.min_perf_pct, 100); in intel_cpufreq_cpu_init()
3401 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.max_perf_pct, 100); in intel_cpufreq_cpu_init()