Lines Matching +full:min +full:- +full:sample +full:- +full:time
1 // SPDX-License-Identifier: GPL-2.0-only
35 #include <asm/intel-family.h>
53 #define ONE_EIGHTH_FP ((int64_t)1 << (FRAC_BITS - 3))
75 mask = (1 << FRAC_BITS) - 1; in ceiling_fp()
92 * struct sample - Store performance sample
94 * performance during last sample period
99 * read from APERF MSR between last and current sample
101 * read from MPERF MSR between last and current sample
102 * @tsc: Difference of time stamp counter between last and
103 * current sample
104 * @time: Current time from scheduler
106 * This structure is used in the cpudata structure to store performance sample
109 struct sample { struct
115 u64 time; member
119 * struct pstate_data - Store P state data
121 * @min_pstate: Min P state possible for this platform
126 * @perf_ctl_scaling: PERF_CTL P-state to frequency scaling factor
149 * struct vid_data - Stores voltage information data
150 * @min: VID data for this platform corresponding to
154 * @ratio: Ratio of (vid max - vid min) /
155 * (max P state - Min P State)
162 int min; member
169 * struct global_params - Global parameters, mostly tunable via sysfs.
170 * @no_turbo: Whether or not to use turbo P-states.
171 * @turbo_disabled: Whether or not turbo P-states are available at all,
173 * not the maximum reported turbo P-state is different from
174 * the maximum reported non-turbo one.
177 * P-state capacity.
179 * P-state capacity.
190 * struct cpudata - Per CPU instance data storage
195 * @iowait_boost: iowait-related boost fraction
196 * @last_update: Time of the last update.
199 * @last_sample_time: Last Sample time
204 * @prev_cummulative_iowait: IO Wait time difference from last and
205 * current sample
206 * @sample: Storage for storing last Sample data
217 * @epp_cached Cached HWP energy-performance preference value
220 * @last_io_update: Last time when IO wake flag was set
222 * @hwp_boost_min: Last HWP boosted min performance
245 struct sample sample; member
269 * struct pstate_funcs - Per CPU model specific callbacks
367 cppc_perf.highest_perf = HWP_HIGHEST_PERF(READ_ONCE(all_cpu_data[cpu]->hwp_cap_cached)); in intel_pstate_set_itmt_prio()
372 * update them at any time after it has been called. in intel_pstate_set_itmt_prio()
442 intel_pstate_set_itmt_prio(policy->cpu); in intel_pstate_init_acpi_perf_limits()
449 cpu = all_cpu_data[policy->cpu]; in intel_pstate_init_acpi_perf_limits()
451 ret = acpi_processor_register_performance(&cpu->acpi_perf_data, in intel_pstate_init_acpi_perf_limits()
452 policy->cpu); in intel_pstate_init_acpi_perf_limits()
461 if (cpu->acpi_perf_data.control_register.space_id != in intel_pstate_init_acpi_perf_limits()
469 if (cpu->acpi_perf_data.state_count < 2) in intel_pstate_init_acpi_perf_limits()
472 pr_debug("CPU%u - ACPI _PSS perf data\n", policy->cpu); in intel_pstate_init_acpi_perf_limits()
473 for (i = 0; i < cpu->acpi_perf_data.state_count; i++) { in intel_pstate_init_acpi_perf_limits()
475 (i == cpu->acpi_perf_data.state ? '*' : ' '), i, in intel_pstate_init_acpi_perf_limits()
476 (u32) cpu->acpi_perf_data.states[i].core_frequency, in intel_pstate_init_acpi_perf_limits()
477 (u32) cpu->acpi_perf_data.states[i].power, in intel_pstate_init_acpi_perf_limits()
478 (u32) cpu->acpi_perf_data.states[i].control); in intel_pstate_init_acpi_perf_limits()
481 cpu->valid_pss_table = true; in intel_pstate_init_acpi_perf_limits()
487 cpu->valid_pss_table = false; in intel_pstate_init_acpi_perf_limits()
488 acpi_processor_unregister_performance(policy->cpu); in intel_pstate_init_acpi_perf_limits()
495 cpu = all_cpu_data[policy->cpu]; in intel_pstate_exit_perf_limits()
496 if (!cpu->valid_pss_table) in intel_pstate_exit_perf_limits()
499 acpi_processor_unregister_performance(policy->cpu); in intel_pstate_exit_perf_limits()
519 return -ENOTSUPP; in intel_pstate_get_cppc_guaranteed()
531 if (freq == cpu->pstate.turbo_freq) in intel_pstate_freq_to_hwp_rel()
532 return cpu->pstate.turbo_pstate; in intel_pstate_freq_to_hwp_rel()
534 if (freq == cpu->pstate.max_freq) in intel_pstate_freq_to_hwp_rel()
535 return cpu->pstate.max_pstate; in intel_pstate_freq_to_hwp_rel()
539 return freq / cpu->pstate.scaling; in intel_pstate_freq_to_hwp_rel()
541 return DIV_ROUND_CLOSEST(freq, cpu->pstate.scaling); in intel_pstate_freq_to_hwp_rel()
544 return DIV_ROUND_UP(freq, cpu->pstate.scaling); in intel_pstate_freq_to_hwp_rel()
553 * intel_pstate_hybrid_hwp_adjust - Calibrate HWP performance levels.
557 * P-states accessible through the PERF_CTL interface. If that happens, the
559 * than the scaling factor between P-state values and CPU frequency.
565 int perf_ctl_max_phys = cpu->pstate.max_pstate_physical; in intel_pstate_hybrid_hwp_adjust()
566 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
567 int perf_ctl_turbo = pstate_funcs.get_turbo(cpu->cpu); in intel_pstate_hybrid_hwp_adjust()
568 int scaling = cpu->pstate.scaling; in intel_pstate_hybrid_hwp_adjust()
571 pr_debug("CPU%d: perf_ctl_max_phys = %d\n", cpu->cpu, perf_ctl_max_phys); in intel_pstate_hybrid_hwp_adjust()
572 pr_debug("CPU%d: perf_ctl_turbo = %d\n", cpu->cpu, perf_ctl_turbo); in intel_pstate_hybrid_hwp_adjust()
573 pr_debug("CPU%d: perf_ctl_scaling = %d\n", cpu->cpu, perf_ctl_scaling); in intel_pstate_hybrid_hwp_adjust()
574 pr_debug("CPU%d: HWP_CAP guaranteed = %d\n", cpu->cpu, cpu->pstate.max_pstate); in intel_pstate_hybrid_hwp_adjust()
575 pr_debug("CPU%d: HWP_CAP highest = %d\n", cpu->cpu, cpu->pstate.turbo_pstate); in intel_pstate_hybrid_hwp_adjust()
576 pr_debug("CPU%d: HWP-to-frequency scaling factor: %d\n", cpu->cpu, scaling); in intel_pstate_hybrid_hwp_adjust()
578 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
580 cpu->pstate.max_freq = rounddown(cpu->pstate.max_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
584 cpu->pstate.max_pstate_physical = intel_pstate_freq_to_hwp(cpu, freq); in intel_pstate_hybrid_hwp_adjust()
586 freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
587 cpu->pstate.min_freq = freq; in intel_pstate_hybrid_hwp_adjust()
589 * Cast the min P-state value retrieved via pstate_funcs.get_min() to in intel_pstate_hybrid_hwp_adjust()
592 cpu->pstate.min_pstate = intel_pstate_freq_to_hwp(cpu, freq); in intel_pstate_hybrid_hwp_adjust()
604 cpu->pstate.max_pstate == cpu->pstate.turbo_pstate); in update_turbo_state()
610 int turbo_pstate = cpu->pstate.turbo_pstate; in min_perf_pct_min()
613 (cpu->pstate.min_pstate * 100 / turbo_pstate) : 0; in min_perf_pct_min()
622 return -ENXIO; in intel_pstate_get_epb()
624 ret = rdmsrl_on_cpu(cpu_data->cpu, MSR_IA32_ENERGY_PERF_BIAS, &epb); in intel_pstate_get_epb()
641 epp = rdmsrl_on_cpu(cpu_data->cpu, MSR_HWP_REQUEST, in intel_pstate_get_epp()
661 return -ENXIO; in intel_pstate_set_epb()
677 *-------------------------------------
712 int index = -EINVAL; in intel_pstate_get_energy_pref_index()
733 * 0x00-0x03 : Performance in intel_pstate_get_energy_pref_index()
734 * 0x04-0x07 : Balance performance in intel_pstate_get_energy_pref_index()
735 * 0x08-0x0B : Balance power in intel_pstate_get_energy_pref_index()
736 * 0x0C-0x0F : Power in intel_pstate_get_energy_pref_index()
754 * intel_pstate_hwp_boost_down() at any time. in intel_pstate_set_epp()
756 u64 value = READ_ONCE(cpu->hwp_req_cached); in intel_pstate_set_epp()
765 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_pstate_set_epp()
766 ret = wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_pstate_set_epp()
768 cpu->epp_cached = epp; in intel_pstate_set_epp()
777 int epp = -EINVAL; in intel_pstate_set_energy_pref_index()
781 epp = cpu_data->epp_default; in intel_pstate_set_energy_pref_index()
786 else if (epp == -EINVAL) in intel_pstate_set_energy_pref_index()
794 if (epp > 0 && cpu_data->policy == CPUFREQ_POLICY_PERFORMANCE) in intel_pstate_set_energy_pref_index()
795 return -EBUSY; in intel_pstate_set_energy_pref_index()
799 if (epp == -EINVAL) in intel_pstate_set_energy_pref_index()
800 epp = (pref_index - 1) << 2; in intel_pstate_set_energy_pref_index()
801 ret = intel_pstate_set_epb(cpu_data->cpu, epp); in intel_pstate_set_energy_pref_index()
828 struct cpudata *cpu = all_cpu_data[policy->cpu]; in store_energy_performance_preference()
836 return -EINVAL; in store_energy_performance_preference()
838 ret = match_string(energy_perf_strings, -1, str_preference); in store_energy_performance_preference()
848 return -EINVAL; in store_energy_performance_preference()
859 return -EAGAIN; in store_energy_performance_preference()
869 * which is super-heavy-weight, so make sure it is worth doing in store_energy_performance_preference()
873 epp = ret ? epp_values[ret] : cpu->epp_default; in store_energy_performance_preference()
875 if (cpu->epp_cached != epp) { in store_energy_performance_preference()
896 struct cpudata *cpu_data = all_cpu_data[policy->cpu]; in show_energy_performance_preference()
913 struct cpudata *cpu = all_cpu_data[policy->cpu]; in show_base_frequency()
916 ratio = intel_pstate_get_cppc_guaranteed(policy->cpu); in show_base_frequency()
920 rdmsrl_on_cpu(policy->cpu, MSR_HWP_CAPABILITIES, &cap); in show_base_frequency()
924 freq = ratio * cpu->pstate.scaling; in show_base_frequency()
925 if (cpu->pstate.scaling != cpu->pstate.perf_ctl_scaling) in show_base_frequency()
926 freq = rounddown(freq, cpu->pstate.perf_ctl_scaling); in show_base_frequency()
944 rdmsrl_on_cpu(cpu->cpu, MSR_HWP_CAPABILITIES, &cap); in __intel_pstate_get_hwp_cap()
945 WRITE_ONCE(cpu->hwp_cap_cached, cap); in __intel_pstate_get_hwp_cap()
946 cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(cap); in __intel_pstate_get_hwp_cap()
947 cpu->pstate.turbo_pstate = HWP_HIGHEST_PERF(cap); in __intel_pstate_get_hwp_cap()
952 int scaling = cpu->pstate.scaling; in intel_pstate_get_hwp_cap()
956 cpu->pstate.max_freq = cpu->pstate.max_pstate * scaling; in intel_pstate_get_hwp_cap()
957 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * scaling; in intel_pstate_get_hwp_cap()
958 if (scaling != cpu->pstate.perf_ctl_scaling) { in intel_pstate_get_hwp_cap()
959 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_get_hwp_cap()
961 cpu->pstate.max_freq = rounddown(cpu->pstate.max_freq, in intel_pstate_get_hwp_cap()
963 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_freq, in intel_pstate_get_hwp_cap()
971 int max, min; in intel_pstate_hwp_set() local
975 max = cpu_data->max_perf_ratio; in intel_pstate_hwp_set()
976 min = cpu_data->min_perf_ratio; in intel_pstate_hwp_set()
978 if (cpu_data->policy == CPUFREQ_POLICY_PERFORMANCE) in intel_pstate_hwp_set()
979 min = max; in intel_pstate_hwp_set()
984 value |= HWP_MIN_PERF(min); in intel_pstate_hwp_set()
989 if (cpu_data->epp_policy == cpu_data->policy) in intel_pstate_hwp_set()
992 cpu_data->epp_policy = cpu_data->policy; in intel_pstate_hwp_set()
994 if (cpu_data->policy == CPUFREQ_POLICY_PERFORMANCE) { in intel_pstate_hwp_set()
996 cpu_data->epp_powersave = epp; in intel_pstate_hwp_set()
1004 if (cpu_data->epp_powersave < 0) in intel_pstate_hwp_set()
1010 * - Policy is not changed in intel_pstate_hwp_set()
1011 * - user has manually changed in intel_pstate_hwp_set()
1012 * - Error reading EPB in intel_pstate_hwp_set()
1018 epp = cpu_data->epp_powersave; in intel_pstate_hwp_set()
1027 WRITE_ONCE(cpu_data->hwp_req_cached, value); in intel_pstate_hwp_set()
1035 u64 value = READ_ONCE(cpu->hwp_req_cached); in intel_pstate_hwp_offline()
1047 value |= HWP_ENERGY_PERF_PREFERENCE(cpu->epp_cached); in intel_pstate_hwp_offline()
1053 cpu->epp_policy = CPUFREQ_POLICY_UNKNOWN; in intel_pstate_hwp_offline()
1062 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_pstate_hwp_offline()
1065 min_perf = HWP_LOWEST_PERF(READ_ONCE(cpu->hwp_cap_cached)); in intel_pstate_hwp_offline()
1071 /* Set EPP to min */ in intel_pstate_hwp_offline()
1075 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_pstate_hwp_offline()
1105 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, READ_ONCE(cpu->hwp_req_cached)); in intel_pstate_hwp_reenable()
1110 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_suspend()
1112 pr_debug("CPU %d suspending\n", cpu->cpu); in intel_pstate_suspend()
1114 cpu->suspended = true; in intel_pstate_suspend()
1124 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_resume()
1126 pr_debug("CPU %d resuming\n", cpu->cpu); in intel_pstate_resume()
1134 if (cpu->suspended && hwp_active) { in intel_pstate_resume()
1137 /* Re-enable HWP, because "online" has not done that. */ in intel_pstate_resume()
1143 cpu->suspended = false; in intel_pstate_resume()
1159 policy->cpuinfo.max_freq = global.turbo_disabled_mf ? in __intel_pstate_update_max_freq()
1160 cpudata->pstate.max_freq : cpudata->pstate.turbo_freq; in __intel_pstate_update_max_freq()
1227 ret = intel_pstate_update_status(buf, p ? p - buf : count); in store_status()
1244 return -EAGAIN; in show_turbo_pct()
1249 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1250 no_turbo = cpu->pstate.max_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1252 turbo_pct = 100 - fp_toint(mul_fp(turbo_fp, int_tofp(100))); in show_turbo_pct()
1269 return -EAGAIN; in show_num_pstates()
1273 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_num_pstates()
1289 return -EAGAIN; in show_no_turbo()
1311 return -EINVAL; in store_no_turbo()
1317 return -EAGAIN; in store_no_turbo()
1327 return -EPERM; in store_no_turbo()
1334 int pct = cpu->pstate.max_pstate * 100 / cpu->pstate.turbo_pstate; in store_no_turbo()
1365 req = policy->driver_data; in update_qos_request()
1381 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * perf_pct, 100); in update_qos_request()
1396 return -EINVAL; in store_max_perf_pct()
1402 return -EAGAIN; in store_max_perf_pct()
1429 return -EINVAL; in store_min_perf_pct()
1435 return -EAGAIN; in store_min_perf_pct()
1538 intel_pstate_kobject = kobject_create_and_add("intel_pstate", &dev_root->kobj); in intel_pstate_sysfs_expose_params()
1623 struct cpufreq_policy *policy = cpufreq_cpu_acquire(cpudata->cpu); in intel_pstate_notify_work()
1632 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_STATUS, 0); in intel_pstate_notify_work()
1674 schedule_delayed_work(&cpudata->hwp_notify_work, msecs_to_jiffies(10)); in notify_hwp_interrupt()
1693 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x00); in intel_pstate_disable_hwp_interrupt()
1696 if (cpumask_test_and_clear_cpu(cpudata->cpu, &hwp_intr_enable_mask)) in intel_pstate_disable_hwp_interrupt()
1697 cancel_delayed_work(&cpudata->hwp_notify_work); in intel_pstate_disable_hwp_interrupt()
1708 INIT_DELAYED_WORK(&cpudata->hwp_notify_work, intel_pstate_notify_work); in intel_pstate_enable_hwp_interrupt()
1709 cpumask_set_cpu(cpudata->cpu, &hwp_intr_enable_mask); in intel_pstate_enable_hwp_interrupt()
1713 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x01); in intel_pstate_enable_hwp_interrupt()
1714 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_STATUS, 0); in intel_pstate_enable_hwp_interrupt()
1720 cpudata->epp_default = intel_pstate_get_epp(cpudata, 0); in intel_pstate_update_epp_defaults()
1731 * - Is equal or less than 0x80 (default balance_perf EPP) in intel_pstate_update_epp_defaults()
1732 * - But less performance oriented than performance EPP in intel_pstate_update_epp_defaults()
1735 if (hwp_forced && cpudata->epp_default <= HWP_EPP_BALANCE_PERFORMANCE && in intel_pstate_update_epp_defaults()
1736 cpudata->epp_default > HWP_EPP_PERFORMANCE) { in intel_pstate_update_epp_defaults()
1737 epp_values[EPP_INDEX_BALANCE_PERFORMANCE] = cpudata->epp_default; in intel_pstate_update_epp_defaults()
1745 cpudata->epp_default = epp_values[EPP_INDEX_BALANCE_PERFORMANCE]; in intel_pstate_update_epp_defaults()
1746 intel_pstate_set_epp(cpudata, cpudata->epp_default); in intel_pstate_update_epp_defaults()
1753 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x00); in intel_pstate_hwp_enable()
1755 wrmsrl_on_cpu(cpudata->cpu, MSR_PM_ENABLE, 0x1); in intel_pstate_hwp_enable()
1759 if (cpudata->epp_default >= 0) in intel_pstate_hwp_enable()
1799 vid_fp = cpudata->vid.min + mul_fp( in atom_get_val()
1800 int_tofp(pstate - cpudata->pstate.min_pstate), in atom_get_val()
1801 cpudata->vid.ratio); in atom_get_val()
1803 vid_fp = clamp_t(int32_t, vid_fp, cpudata->vid.min, cpudata->vid.max); in atom_get_val()
1806 if (pstate > cpudata->pstate.max_pstate) in atom_get_val()
1807 vid = cpudata->vid.turbo; in atom_get_val()
1816 /* Defined in Table 35-6 from SDM (Sept 2015) */ in silvermont_get_scaling()
1831 /* Defined in Table 35-10 from SDM (Sept 2015) */ in airmont_get_scaling()
1848 cpudata->vid.min = int_tofp((value >> 8) & 0x7f); in atom_get_vid()
1849 cpudata->vid.max = int_tofp((value >> 16) & 0x7f); in atom_get_vid()
1850 cpudata->vid.ratio = div_fp( in atom_get_vid()
1851 cpudata->vid.max - cpudata->vid.min, in atom_get_vid()
1852 int_tofp(cpudata->pstate.max_pstate - in atom_get_vid()
1853 cpudata->pstate.min_pstate)); in atom_get_vid()
1856 cpudata->vid.turbo = value & 0x7f; in atom_get_vid()
1905 return -ENXIO; in core_get_tdp_ratio()
1934 if (tdp_ratio - 1 == tar_levels) { in core_get_max_pstate()
1997 /* P-cores have a smaller perf level-to-freqency scaling factor. */ in hwp_get_cpu_scaling()
2001 /* Use default core scaling for E-cores */ in hwp_get_cpu_scaling()
2006 * If reached here, this system is either non-hybrid (like Tiger in hwp_get_cpu_scaling()
2007 * Lake) or hybrid-capable (like Alder Lake or Raptor Lake) with in hwp_get_cpu_scaling()
2010 * The CPPC nominal_frequency field is 0 for non-hybrid systems, in hwp_get_cpu_scaling()
2018 trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_set_pstate()
2019 cpu->pstate.current_pstate = pstate; in intel_pstate_set_pstate()
2025 wrmsrl_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL, in intel_pstate_set_pstate()
2031 intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); in intel_pstate_set_min_pstate()
2036 int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); in intel_pstate_max_within_limits()
2044 int perf_ctl_max_phys = pstate_funcs.get_max_physical(cpu->cpu); in intel_pstate_get_cpu_pstates()
2047 cpu->pstate.min_pstate = pstate_funcs.get_min(cpu->cpu); in intel_pstate_get_cpu_pstates()
2048 cpu->pstate.max_pstate_physical = perf_ctl_max_phys; in intel_pstate_get_cpu_pstates()
2049 cpu->pstate.perf_ctl_scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2055 cpu->pstate.scaling = pstate_funcs.get_cpu_scaling(cpu->cpu); in intel_pstate_get_cpu_pstates()
2056 if (cpu->pstate.scaling != perf_ctl_scaling) in intel_pstate_get_cpu_pstates()
2059 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2062 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2063 cpu->pstate.max_pstate = pstate_funcs.get_max(cpu->cpu); in intel_pstate_get_cpu_pstates()
2064 cpu->pstate.turbo_pstate = pstate_funcs.get_turbo(cpu->cpu); in intel_pstate_get_cpu_pstates()
2067 if (cpu->pstate.scaling == perf_ctl_scaling) { in intel_pstate_get_cpu_pstates()
2068 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2069 cpu->pstate.max_freq = cpu->pstate.max_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2070 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2074 cpu->aperf_mperf_shift = pstate_funcs.get_aperf_mperf_shift(); in intel_pstate_get_cpu_pstates()
2083 * Long hold time will keep high perf limits for long time,
2092 u64 hwp_req = READ_ONCE(cpu->hwp_req_cached); in intel_pstate_hwp_boost_up()
2093 u64 hwp_cap = READ_ONCE(cpu->hwp_cap_cached); in intel_pstate_hwp_boost_up()
2099 * Cases to consider (User changes via sysfs or boot time): in intel_pstate_hwp_boost_up()
2100 * If, P0 (Turbo max) = P1 (Guaranteed max) = min: in intel_pstate_hwp_boost_up()
2102 * If, P0 (Turbo max) > P1 (Guaranteed max) = min: in intel_pstate_hwp_boost_up()
2104 * If, P0 (Turbo max) = P1 (Guaranteed max) > min: in intel_pstate_hwp_boost_up()
2106 * (min + p1)/2 and P1. in intel_pstate_hwp_boost_up()
2107 * If, P0 (Turbo max) > P1 (Guaranteed max) > min: in intel_pstate_hwp_boost_up()
2109 * (min + p1)/2, P1 and P0. in intel_pstate_hwp_boost_up()
2112 /* If max and min are equal or already at max, nothing to boost */ in intel_pstate_hwp_boost_up()
2113 if (max_limit == min_limit || cpu->hwp_boost_min >= max_limit) in intel_pstate_hwp_boost_up()
2116 if (!cpu->hwp_boost_min) in intel_pstate_hwp_boost_up()
2117 cpu->hwp_boost_min = min_limit; in intel_pstate_hwp_boost_up()
2119 /* level at half way mark between min and guranteed */ in intel_pstate_hwp_boost_up()
2122 if (cpu->hwp_boost_min < boost_level1) in intel_pstate_hwp_boost_up()
2123 cpu->hwp_boost_min = boost_level1; in intel_pstate_hwp_boost_up()
2124 else if (cpu->hwp_boost_min < HWP_GUARANTEED_PERF(hwp_cap)) in intel_pstate_hwp_boost_up()
2125 cpu->hwp_boost_min = HWP_GUARANTEED_PERF(hwp_cap); in intel_pstate_hwp_boost_up()
2126 else if (cpu->hwp_boost_min == HWP_GUARANTEED_PERF(hwp_cap) && in intel_pstate_hwp_boost_up()
2128 cpu->hwp_boost_min = max_limit; in intel_pstate_hwp_boost_up()
2132 hwp_req = (hwp_req & ~GENMASK_ULL(7, 0)) | cpu->hwp_boost_min; in intel_pstate_hwp_boost_up()
2134 cpu->last_update = cpu->sample.time; in intel_pstate_hwp_boost_up()
2139 if (cpu->hwp_boost_min) { in intel_pstate_hwp_boost_down()
2142 /* Check if we are idle for hold time to boost down */ in intel_pstate_hwp_boost_down()
2143 expired = time_after64(cpu->sample.time, cpu->last_update + in intel_pstate_hwp_boost_down()
2146 wrmsrl(MSR_HWP_REQUEST, cpu->hwp_req_cached); in intel_pstate_hwp_boost_down()
2147 cpu->hwp_boost_min = 0; in intel_pstate_hwp_boost_down()
2150 cpu->last_update = cpu->sample.time; in intel_pstate_hwp_boost_down()
2154 u64 time) in intel_pstate_update_util_hwp_local() argument
2156 cpu->sample.time = time; in intel_pstate_update_util_hwp_local()
2158 if (cpu->sched_flags & SCHED_CPUFREQ_IOWAIT) { in intel_pstate_update_util_hwp_local()
2161 cpu->sched_flags = 0; in intel_pstate_update_util_hwp_local()
2163 * Set iowait_boost flag and update time. Since IO WAIT flag in intel_pstate_update_util_hwp_local()
2164 * is set all the time, we can't just conclude that there is in intel_pstate_update_util_hwp_local()
2169 if (time_before64(time, cpu->last_io_update + 2 * TICK_NSEC)) in intel_pstate_update_util_hwp_local()
2172 cpu->last_io_update = time; in intel_pstate_update_util_hwp_local()
2183 u64 time, unsigned int flags) in intel_pstate_update_util_hwp() argument
2187 cpu->sched_flags |= flags; in intel_pstate_update_util_hwp()
2189 if (smp_processor_id() == cpu->cpu) in intel_pstate_update_util_hwp()
2190 intel_pstate_update_util_hwp_local(cpu, time); in intel_pstate_update_util_hwp()
2195 struct sample *sample = &cpu->sample; in intel_pstate_calc_avg_perf() local
2197 sample->core_avg_perf = div_ext_fp(sample->aperf, sample->mperf); in intel_pstate_calc_avg_perf()
2200 static inline bool intel_pstate_sample(struct cpudata *cpu, u64 time) in intel_pstate_sample() argument
2210 if (cpu->prev_mperf == mperf || cpu->prev_tsc == tsc) { in intel_pstate_sample()
2216 cpu->last_sample_time = cpu->sample.time; in intel_pstate_sample()
2217 cpu->sample.time = time; in intel_pstate_sample()
2218 cpu->sample.aperf = aperf; in intel_pstate_sample()
2219 cpu->sample.mperf = mperf; in intel_pstate_sample()
2220 cpu->sample.tsc = tsc; in intel_pstate_sample()
2221 cpu->sample.aperf -= cpu->prev_aperf; in intel_pstate_sample()
2222 cpu->sample.mperf -= cpu->prev_mperf; in intel_pstate_sample()
2223 cpu->sample.tsc -= cpu->prev_tsc; in intel_pstate_sample()
2225 cpu->prev_aperf = aperf; in intel_pstate_sample()
2226 cpu->prev_mperf = mperf; in intel_pstate_sample()
2227 cpu->prev_tsc = tsc; in intel_pstate_sample()
2229 * First time this function is invoked in a given cycle, all of the in intel_pstate_sample()
2230 * previous sample data fields are equal to zero or stale and they must in intel_pstate_sample()
2232 * that sample.time will always be reset before setting the utilization in intel_pstate_sample()
2233 * update hook and make the caller skip the sample then. in intel_pstate_sample()
2235 if (cpu->last_sample_time) { in intel_pstate_sample()
2244 return mul_ext_fp(cpu->sample.core_avg_perf, cpu_khz); in get_avg_frequency()
2249 return mul_ext_fp(cpu->pstate.max_pstate_physical, in get_avg_pstate()
2250 cpu->sample.core_avg_perf); in get_avg_pstate()
2255 struct sample *sample = &cpu->sample; in get_target_pstate() local
2259 busy_frac = div_fp(sample->mperf << cpu->aperf_mperf_shift, in get_target_pstate()
2260 sample->tsc); in get_target_pstate()
2262 if (busy_frac < cpu->iowait_boost) in get_target_pstate()
2263 busy_frac = cpu->iowait_boost; in get_target_pstate()
2265 sample->busy_scaled = busy_frac * 100; in get_target_pstate()
2268 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; in get_target_pstate()
2271 if (target < cpu->pstate.min_pstate) in get_target_pstate()
2272 target = cpu->pstate.min_pstate; in get_target_pstate()
2275 * If the average P-state during the previous cycle was higher than the in get_target_pstate()
2283 target += (avg_pstate - target) >> 1; in get_target_pstate()
2290 int min_pstate = max(cpu->pstate.min_pstate, cpu->min_perf_ratio); in intel_pstate_prepare_request()
2291 int max_pstate = max(min_pstate, cpu->max_perf_ratio); in intel_pstate_prepare_request()
2298 if (pstate == cpu->pstate.current_pstate) in intel_pstate_update_pstate()
2301 cpu->pstate.current_pstate = pstate; in intel_pstate_update_pstate()
2307 int from = cpu->pstate.current_pstate; in intel_pstate_adjust_pstate()
2308 struct sample *sample; in intel_pstate_adjust_pstate() local
2315 trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_adjust_pstate()
2318 sample = &cpu->sample; in intel_pstate_adjust_pstate()
2319 trace_pstate_sample(mul_ext_fp(100, sample->core_avg_perf), in intel_pstate_adjust_pstate()
2320 fp_toint(sample->busy_scaled), in intel_pstate_adjust_pstate()
2322 cpu->pstate.current_pstate, in intel_pstate_adjust_pstate()
2323 sample->mperf, in intel_pstate_adjust_pstate()
2324 sample->aperf, in intel_pstate_adjust_pstate()
2325 sample->tsc, in intel_pstate_adjust_pstate()
2327 fp_toint(cpu->iowait_boost * 100)); in intel_pstate_adjust_pstate()
2330 static void intel_pstate_update_util(struct update_util_data *data, u64 time, in intel_pstate_update_util() argument
2337 if (smp_processor_id() != cpu->cpu) in intel_pstate_update_util()
2340 delta_ns = time - cpu->last_update; in intel_pstate_update_util()
2344 cpu->iowait_boost = ONE_EIGHTH_FP; in intel_pstate_update_util()
2345 } else if (cpu->iowait_boost >= ONE_EIGHTH_FP) { in intel_pstate_update_util()
2346 cpu->iowait_boost <<= 1; in intel_pstate_update_util()
2347 if (cpu->iowait_boost > int_tofp(1)) in intel_pstate_update_util()
2348 cpu->iowait_boost = int_tofp(1); in intel_pstate_update_util()
2350 cpu->iowait_boost = ONE_EIGHTH_FP; in intel_pstate_update_util()
2352 } else if (cpu->iowait_boost) { in intel_pstate_update_util()
2355 cpu->iowait_boost = 0; in intel_pstate_update_util()
2357 cpu->iowait_boost >>= 1; in intel_pstate_update_util()
2359 cpu->last_update = time; in intel_pstate_update_util()
2360 delta_ns = time - cpu->sample.time; in intel_pstate_update_util()
2364 if (intel_pstate_sample(cpu, time)) in intel_pstate_update_util()
2464 return -ENOMEM; in intel_pstate_init_cpu()
2468 cpu->cpu = cpunum; in intel_pstate_init_cpu()
2470 cpu->epp_default = -EINVAL; in intel_pstate_init_cpu()
2480 * Re-enable HWP in case this happens after a resume from ACPI in intel_pstate_init_cpu()
2487 cpu->epp_powersave = -EINVAL; in intel_pstate_init_cpu()
2488 cpu->epp_policy = 0; in intel_pstate_init_cpu()
2504 if (cpu->update_util_set) in intel_pstate_set_update_util_hook()
2508 cpu->sample.time = 0; in intel_pstate_set_update_util_hook()
2509 cpufreq_add_update_util_hook(cpu_num, &cpu->update_util, in intel_pstate_set_update_util_hook()
2513 cpu->update_util_set = true; in intel_pstate_set_update_util_hook()
2520 if (!cpu_data->update_util_set) in intel_pstate_clear_update_util_hook()
2524 cpu_data->update_util_set = false; in intel_pstate_clear_update_util_hook()
2531 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_get_max_freq()
2538 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_update_perf_limits()
2554 if (hwp_active && cpu->pstate.scaling != perf_ctl_scaling) { in intel_pstate_update_perf_limits()
2564 cpu->cpu, min_policy_perf, max_policy_perf); in intel_pstate_update_perf_limits()
2568 cpu->min_perf_ratio = min_policy_perf; in intel_pstate_update_perf_limits()
2569 cpu->max_perf_ratio = max_policy_perf; in intel_pstate_update_perf_limits()
2571 int turbo_max = cpu->pstate.turbo_pstate; in intel_pstate_update_perf_limits()
2574 /* Global limits are in percent of the maximum turbo P-state. */ in intel_pstate_update_perf_limits()
2579 pr_debug("cpu:%d global_min:%d global_max:%d\n", cpu->cpu, in intel_pstate_update_perf_limits()
2582 cpu->min_perf_ratio = max(min_policy_perf, global_min); in intel_pstate_update_perf_limits()
2583 cpu->min_perf_ratio = min(cpu->min_perf_ratio, max_policy_perf); in intel_pstate_update_perf_limits()
2584 cpu->max_perf_ratio = min(max_policy_perf, global_max); in intel_pstate_update_perf_limits()
2585 cpu->max_perf_ratio = max(min_policy_perf, cpu->max_perf_ratio); in intel_pstate_update_perf_limits()
2588 cpu->min_perf_ratio = min(cpu->min_perf_ratio, in intel_pstate_update_perf_limits()
2589 cpu->max_perf_ratio); in intel_pstate_update_perf_limits()
2592 pr_debug("cpu:%d max_perf_ratio:%d min_perf_ratio:%d\n", cpu->cpu, in intel_pstate_update_perf_limits()
2593 cpu->max_perf_ratio, in intel_pstate_update_perf_limits()
2594 cpu->min_perf_ratio); in intel_pstate_update_perf_limits()
2601 if (!policy->cpuinfo.max_freq) in intel_pstate_set_policy()
2602 return -ENODEV; in intel_pstate_set_policy()
2604 pr_debug("set_policy cpuinfo.max %u policy->max %u\n", in intel_pstate_set_policy()
2605 policy->cpuinfo.max_freq, policy->max); in intel_pstate_set_policy()
2607 cpu = all_cpu_data[policy->cpu]; in intel_pstate_set_policy()
2608 cpu->policy = policy->policy; in intel_pstate_set_policy()
2612 intel_pstate_update_perf_limits(cpu, policy->min, policy->max); in intel_pstate_set_policy()
2614 if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) { in intel_pstate_set_policy()
2619 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2622 intel_pstate_set_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2632 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2633 intel_pstate_hwp_set(policy->cpu); in intel_pstate_set_policy()
2636 * policy->cur is never updated with the intel_pstate driver, but it in intel_pstate_set_policy()
2639 policy->cur = policy->min; in intel_pstate_set_policy()
2650 cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate && in intel_pstate_adjust_policy_max()
2651 policy->max < policy->cpuinfo.max_freq && in intel_pstate_adjust_policy_max()
2652 policy->max > cpu->pstate.max_freq) { in intel_pstate_adjust_policy_max()
2653 pr_debug("policy->max > max non turbo frequency\n"); in intel_pstate_adjust_policy_max()
2654 policy->max = policy->cpuinfo.max_freq; in intel_pstate_adjust_policy_max()
2667 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_verify_cpu_policy()
2671 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, max_freq); in intel_pstate_verify_cpu_policy()
2678 intel_pstate_verify_cpu_policy(all_cpu_data[policy->cpu], policy); in intel_pstate_verify_policy()
2685 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_cpu_offline()
2687 pr_debug("CPU %d going offline\n", cpu->cpu); in intel_cpufreq_cpu_offline()
2689 if (cpu->suspended) in intel_cpufreq_cpu_offline()
2710 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_cpu_online()
2712 pr_debug("CPU %d going online\n", cpu->cpu); in intel_pstate_cpu_online()
2718 * Re-enable HWP and clear the "suspended" flag to let "resume" in intel_pstate_cpu_online()
2722 cpu->suspended = false; in intel_pstate_cpu_online()
2730 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_cpu_offline()
2737 pr_debug("CPU %d exiting\n", policy->cpu); in intel_pstate_cpu_exit()
2739 policy->fast_switch_possible = false; in intel_pstate_cpu_exit()
2749 rc = intel_pstate_init_cpu(policy->cpu); in __intel_pstate_cpu_init()
2753 cpu = all_cpu_data[policy->cpu]; in __intel_pstate_cpu_init()
2755 cpu->max_perf_ratio = 0xFF; in __intel_pstate_cpu_init()
2756 cpu->min_perf_ratio = 0; in __intel_pstate_cpu_init()
2759 policy->cpuinfo.min_freq = cpu->pstate.min_freq; in __intel_pstate_cpu_init()
2762 policy->cpuinfo.max_freq = global.turbo_disabled ? in __intel_pstate_cpu_init()
2763 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in __intel_pstate_cpu_init()
2765 policy->min = policy->cpuinfo.min_freq; in __intel_pstate_cpu_init()
2766 policy->max = policy->cpuinfo.max_freq; in __intel_pstate_cpu_init()
2770 policy->fast_switch_possible = true; in __intel_pstate_cpu_init()
2786 policy->policy = CPUFREQ_POLICY_POWERSAVE; in intel_pstate_cpu_init()
2789 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_cpu_init()
2791 cpu->epp_cached = intel_pstate_get_epp(cpu, 0); in intel_pstate_cpu_init()
2813 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_verify_policy()
2816 intel_pstate_update_perf_limits(cpu, policy->min, policy->max); in intel_cpufreq_verify_policy()
2825 * core_avg_perf) is not needed and so is re-assigned to indicate if the
2828 * (or performance or core_avg_perf) have a fixed y-axis from 0 to 100%,
2839 struct sample *sample; in intel_cpufreq_trace() local
2847 sample = &cpu->sample; in intel_cpufreq_trace()
2851 cpu->pstate.current_pstate, in intel_cpufreq_trace()
2852 sample->mperf, in intel_cpufreq_trace()
2853 sample->aperf, in intel_cpufreq_trace()
2854 sample->tsc, in intel_cpufreq_trace()
2856 fp_toint(cpu->iowait_boost * 100)); in intel_cpufreq_trace()
2859 static void intel_cpufreq_hwp_update(struct cpudata *cpu, u32 min, u32 max, in intel_cpufreq_hwp_update() argument
2862 u64 prev = READ_ONCE(cpu->hwp_req_cached), value = prev; in intel_cpufreq_hwp_update()
2865 value |= HWP_MIN_PERF(min); in intel_cpufreq_hwp_update()
2876 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_cpufreq_hwp_update()
2880 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_cpufreq_hwp_update()
2890 wrmsrl_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL, in intel_cpufreq_perf_ctl_update()
2897 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_update_pstate()
2898 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_update_pstate()
2902 int max_pstate = policy->strict_target ? in intel_cpufreq_update_pstate()
2903 target_pstate : cpu->max_perf_ratio; in intel_cpufreq_update_pstate()
2911 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_update_pstate()
2923 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_target()
2929 freqs.old = policy->cur; in intel_cpufreq_target()
2937 freqs.new = target_pstate * cpu->pstate.scaling; in intel_cpufreq_target()
2947 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_fast_switch()
2956 return target_pstate * cpu->pstate.scaling; in intel_cpufreq_fast_switch()
2965 u64 hwp_cap = READ_ONCE(cpu->hwp_cap_cached); in intel_cpufreq_adjust_perf()
2966 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_adjust_perf()
2983 if (min_pstate < cpu->pstate.min_pstate) in intel_cpufreq_adjust_perf()
2984 min_pstate = cpu->pstate.min_pstate; in intel_cpufreq_adjust_perf()
2986 if (min_pstate < cpu->min_perf_ratio) in intel_cpufreq_adjust_perf()
2987 min_pstate = cpu->min_perf_ratio; in intel_cpufreq_adjust_perf()
2989 if (min_pstate > cpu->max_perf_ratio) in intel_cpufreq_adjust_perf()
2990 min_pstate = cpu->max_perf_ratio; in intel_cpufreq_adjust_perf()
2992 max_pstate = min(cap_pstate, cpu->max_perf_ratio); in intel_cpufreq_adjust_perf()
3000 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_adjust_perf()
3011 dev = get_cpu_device(policy->cpu); in intel_cpufreq_cpu_init()
3013 return -ENODEV; in intel_cpufreq_cpu_init()
3019 policy->cpuinfo.transition_latency = INTEL_CPUFREQ_TRANSITION_LATENCY; in intel_cpufreq_cpu_init()
3021 policy->cur = policy->cpuinfo.min_freq; in intel_cpufreq_cpu_init()
3025 ret = -ENOMEM; in intel_cpufreq_cpu_init()
3029 cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_cpu_init()
3034 policy->transition_delay_us = INTEL_CPUFREQ_TRANSITION_DELAY_HWP; in intel_cpufreq_cpu_init()
3038 rdmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, &value); in intel_cpufreq_cpu_init()
3039 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_cpufreq_cpu_init()
3041 cpu->epp_cached = intel_pstate_get_epp(cpu, value); in intel_cpufreq_cpu_init()
3043 policy->transition_delay_us = INTEL_CPUFREQ_TRANSITION_DELAY; in intel_cpufreq_cpu_init()
3046 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.min_perf_pct, 100); in intel_cpufreq_cpu_init()
3048 ret = freq_qos_add_request(&policy->constraints, req, FREQ_QOS_MIN, in intel_cpufreq_cpu_init()
3051 dev_err(dev, "Failed to add min-freq constraint (%d)\n", ret); in intel_cpufreq_cpu_init()
3055 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.max_perf_pct, 100); in intel_cpufreq_cpu_init()
3057 ret = freq_qos_add_request(&policy->constraints, req + 1, FREQ_QOS_MAX, in intel_cpufreq_cpu_init()
3060 dev_err(dev, "Failed to add max-freq constraint (%d)\n", ret); in intel_cpufreq_cpu_init()
3064 policy->driver_data = req; in intel_cpufreq_cpu_init()
3082 req = policy->driver_data; in intel_cpufreq_cpu_exit()
3096 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_suspend()
3097 u64 value = READ_ONCE(cpu->hwp_req_cached); in intel_cpufreq_suspend()
3105 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_cpufreq_suspend()
3106 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_cpufreq_suspend()
3185 return -EINVAL; in intel_pstate_update_status()
3188 return -EBUSY; in intel_pstate_update_status()
3218 return -EINVAL; in intel_pstate_update_status()
3231 return -ENODEV; in intel_pstate_msrs_not_valid()
3238 pstate_funcs.get_max = funcs->get_max; in copy_cpu_funcs()
3239 pstate_funcs.get_max_physical = funcs->get_max_physical; in copy_cpu_funcs()
3240 pstate_funcs.get_min = funcs->get_min; in copy_cpu_funcs()
3241 pstate_funcs.get_turbo = funcs->get_turbo; in copy_cpu_funcs()
3242 pstate_funcs.get_scaling = funcs->get_scaling; in copy_cpu_funcs()
3243 pstate_funcs.get_val = funcs->get_val; in copy_cpu_funcs()
3244 pstate_funcs.get_vid = funcs->get_vid; in copy_cpu_funcs()
3245 pstate_funcs.get_aperf_mperf_shift = funcs->get_aperf_mperf_shift; in copy_cpu_funcs()
3263 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); in intel_pstate_no_acpi_pss()
3268 if (pss && pss->type == ACPI_TYPE_PACKAGE) { in intel_pstate_no_acpi_pss()
3306 if (acpi_has_method(pr->handle, "_PPC")) in intel_pstate_has_acpi_ppc()
3318 /* Hardware vendor-specific info that has its own power management modes */
3321 {"ORACLE", "X4-2 ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3322 {"ORACLE", "X4-2L ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3323 {"ORACLE", "X4-2B ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3324 {"ORACLE", "X3-2 ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3325 {"ORACLE", "X3-2L ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3326 {"ORACLE", "X3-2B ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3333 {"ORACLE", "X6-2 ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3376 * It may be unsafe to request P-states control from SMM if _PPC support in intel_pstate_request_control_from_smm()
3427 return -ENODEV; in intel_pstate_init()
3436 return -ENODEV; in intel_pstate_init()
3449 hwp_mode_bdw = id->driver_data; in intel_pstate_init()
3464 return -ENODEV; in intel_pstate_init()
3469 return -ENODEV; in intel_pstate_init()
3472 copy_cpu_funcs((struct pstate_funcs *)id->driver_data); in intel_pstate_init()
3477 return -ENODEV; in intel_pstate_init()
3489 pr_info("P-states controlled by the platform\n"); in intel_pstate_init()
3490 return -ENODEV; in intel_pstate_init()
3494 return -ENOTSUPP; in intel_pstate_init()
3496 pr_info("Intel P-state driver initializing\n"); in intel_pstate_init()
3500 return -ENOMEM; in intel_pstate_init()
3512 epp_values[EPP_INDEX_BALANCE_PERFORMANCE] = id->driver_data; in intel_pstate_init()
3544 return -EINVAL; in intel_pstate_setup()
3573 MODULE_DESCRIPTION("'intel_pstate' - P state driver Intel Core processors");