• Home
  • Raw
  • Download

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
368 cppc_perf.highest_perf = HWP_HIGHEST_PERF(READ_ONCE(all_cpu_data[cpu]->hwp_cap_cached)); in intel_pstate_set_itmt_prio()
373 * update them at any time after it has been called. in intel_pstate_set_itmt_prio()
443 intel_pstate_set_itmt_prio(policy->cpu); in intel_pstate_init_acpi_perf_limits()
450 cpu = all_cpu_data[policy->cpu]; in intel_pstate_init_acpi_perf_limits()
452 ret = acpi_processor_register_performance(&cpu->acpi_perf_data, in intel_pstate_init_acpi_perf_limits()
453 policy->cpu); in intel_pstate_init_acpi_perf_limits()
462 if (cpu->acpi_perf_data.control_register.space_id != in intel_pstate_init_acpi_perf_limits()
470 if (cpu->acpi_perf_data.state_count < 2) in intel_pstate_init_acpi_perf_limits()
473 pr_debug("CPU%u - ACPI _PSS perf data\n", policy->cpu); in intel_pstate_init_acpi_perf_limits()
474 for (i = 0; i < cpu->acpi_perf_data.state_count; i++) { in intel_pstate_init_acpi_perf_limits()
476 (i == cpu->acpi_perf_data.state ? '*' : ' '), i, in intel_pstate_init_acpi_perf_limits()
477 (u32) cpu->acpi_perf_data.states[i].core_frequency, in intel_pstate_init_acpi_perf_limits()
478 (u32) cpu->acpi_perf_data.states[i].power, in intel_pstate_init_acpi_perf_limits()
479 (u32) cpu->acpi_perf_data.states[i].control); in intel_pstate_init_acpi_perf_limits()
482 cpu->valid_pss_table = true; in intel_pstate_init_acpi_perf_limits()
488 cpu->valid_pss_table = false; in intel_pstate_init_acpi_perf_limits()
489 acpi_processor_unregister_performance(policy->cpu); in intel_pstate_init_acpi_perf_limits()
496 cpu = all_cpu_data[policy->cpu]; in intel_pstate_exit_perf_limits()
497 if (!cpu->valid_pss_table) in intel_pstate_exit_perf_limits()
500 acpi_processor_unregister_performance(policy->cpu); in intel_pstate_exit_perf_limits()
520 return -ENOTSUPP; in intel_pstate_get_cppc_guaranteed()
532 if (freq == cpu->pstate.turbo_freq) in intel_pstate_freq_to_hwp_rel()
533 return cpu->pstate.turbo_pstate; in intel_pstate_freq_to_hwp_rel()
535 if (freq == cpu->pstate.max_freq) in intel_pstate_freq_to_hwp_rel()
536 return cpu->pstate.max_pstate; in intel_pstate_freq_to_hwp_rel()
540 return freq / cpu->pstate.scaling; in intel_pstate_freq_to_hwp_rel()
542 return DIV_ROUND_CLOSEST(freq, cpu->pstate.scaling); in intel_pstate_freq_to_hwp_rel()
545 return DIV_ROUND_UP(freq, cpu->pstate.scaling); in intel_pstate_freq_to_hwp_rel()
554 * intel_pstate_hybrid_hwp_adjust - Calibrate HWP performance levels.
558 * P-states accessible through the PERF_CTL interface. If that happens, the
560 * than the scaling factor between P-state values and CPU frequency.
566 int perf_ctl_max_phys = cpu->pstate.max_pstate_physical; in intel_pstate_hybrid_hwp_adjust()
567 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
568 int perf_ctl_turbo = pstate_funcs.get_turbo(cpu->cpu); in intel_pstate_hybrid_hwp_adjust()
569 int scaling = cpu->pstate.scaling; in intel_pstate_hybrid_hwp_adjust()
572 pr_debug("CPU%d: perf_ctl_max_phys = %d\n", cpu->cpu, perf_ctl_max_phys); in intel_pstate_hybrid_hwp_adjust()
573 pr_debug("CPU%d: perf_ctl_turbo = %d\n", cpu->cpu, perf_ctl_turbo); in intel_pstate_hybrid_hwp_adjust()
574 pr_debug("CPU%d: perf_ctl_scaling = %d\n", cpu->cpu, perf_ctl_scaling); in intel_pstate_hybrid_hwp_adjust()
575 pr_debug("CPU%d: HWP_CAP guaranteed = %d\n", cpu->cpu, cpu->pstate.max_pstate); in intel_pstate_hybrid_hwp_adjust()
576 pr_debug("CPU%d: HWP_CAP highest = %d\n", cpu->cpu, cpu->pstate.turbo_pstate); in intel_pstate_hybrid_hwp_adjust()
577 pr_debug("CPU%d: HWP-to-frequency scaling factor: %d\n", cpu->cpu, scaling); in intel_pstate_hybrid_hwp_adjust()
579 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
581 cpu->pstate.max_freq = rounddown(cpu->pstate.max_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
585 cpu->pstate.max_pstate_physical = intel_pstate_freq_to_hwp(cpu, freq); in intel_pstate_hybrid_hwp_adjust()
587 freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
588 cpu->pstate.min_freq = freq; in intel_pstate_hybrid_hwp_adjust()
590 * Cast the min P-state value retrieved via pstate_funcs.get_min() to in intel_pstate_hybrid_hwp_adjust()
593 cpu->pstate.min_pstate = intel_pstate_freq_to_hwp(cpu, freq); in intel_pstate_hybrid_hwp_adjust()
605 cpu->pstate.max_pstate == cpu->pstate.turbo_pstate); in update_turbo_state()
611 int turbo_pstate = cpu->pstate.turbo_pstate; in min_perf_pct_min()
614 (cpu->pstate.min_pstate * 100 / turbo_pstate) : 0; in min_perf_pct_min()
623 return -ENXIO; in intel_pstate_get_epb()
625 ret = rdmsrl_on_cpu(cpu_data->cpu, MSR_IA32_ENERGY_PERF_BIAS, &epb); in intel_pstate_get_epb()
642 epp = rdmsrl_on_cpu(cpu_data->cpu, MSR_HWP_REQUEST, in intel_pstate_get_epp()
662 return -ENXIO; in intel_pstate_set_epb()
678 *-------------------------------------
713 int index = -EINVAL; in intel_pstate_get_energy_pref_index()
734 * 0x00-0x03 : Performance in intel_pstate_get_energy_pref_index()
735 * 0x04-0x07 : Balance performance in intel_pstate_get_energy_pref_index()
736 * 0x08-0x0B : Balance power in intel_pstate_get_energy_pref_index()
737 * 0x0C-0x0F : Power in intel_pstate_get_energy_pref_index()
755 * intel_pstate_hwp_boost_down() at any time. in intel_pstate_set_epp()
757 u64 value = READ_ONCE(cpu->hwp_req_cached); in intel_pstate_set_epp()
766 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_pstate_set_epp()
767 ret = wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_pstate_set_epp()
769 cpu->epp_cached = epp; in intel_pstate_set_epp()
778 int epp = -EINVAL; in intel_pstate_set_energy_pref_index()
782 epp = cpu_data->epp_default; in intel_pstate_set_energy_pref_index()
787 else if (epp == -EINVAL) in intel_pstate_set_energy_pref_index()
795 if (epp > 0 && cpu_data->policy == CPUFREQ_POLICY_PERFORMANCE) in intel_pstate_set_energy_pref_index()
796 return -EBUSY; in intel_pstate_set_energy_pref_index()
800 if (epp == -EINVAL) in intel_pstate_set_energy_pref_index()
801 epp = (pref_index - 1) << 2; in intel_pstate_set_energy_pref_index()
802 ret = intel_pstate_set_epb(cpu_data->cpu, epp); in intel_pstate_set_energy_pref_index()
829 struct cpudata *cpu = all_cpu_data[policy->cpu]; in store_energy_performance_preference()
837 return -EINVAL; in store_energy_performance_preference()
839 ret = match_string(energy_perf_strings, -1, str_preference); in store_energy_performance_preference()
849 return -EINVAL; in store_energy_performance_preference()
860 return -EAGAIN; in store_energy_performance_preference()
870 * which is super-heavy-weight, so make sure it is worth doing in store_energy_performance_preference()
874 epp = ret ? epp_values[ret] : cpu->epp_default; in store_energy_performance_preference()
876 if (cpu->epp_cached != epp) { in store_energy_performance_preference()
897 struct cpudata *cpu_data = all_cpu_data[policy->cpu]; in show_energy_performance_preference()
914 struct cpudata *cpu = all_cpu_data[policy->cpu]; in show_base_frequency()
917 ratio = intel_pstate_get_cppc_guaranteed(policy->cpu); in show_base_frequency()
921 rdmsrl_on_cpu(policy->cpu, MSR_HWP_CAPABILITIES, &cap); in show_base_frequency()
925 freq = ratio * cpu->pstate.scaling; in show_base_frequency()
926 if (cpu->pstate.scaling != cpu->pstate.perf_ctl_scaling) in show_base_frequency()
927 freq = rounddown(freq, cpu->pstate.perf_ctl_scaling); in show_base_frequency()
945 rdmsrl_on_cpu(cpu->cpu, MSR_HWP_CAPABILITIES, &cap); in __intel_pstate_get_hwp_cap()
946 WRITE_ONCE(cpu->hwp_cap_cached, cap); in __intel_pstate_get_hwp_cap()
947 cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(cap); in __intel_pstate_get_hwp_cap()
948 cpu->pstate.turbo_pstate = HWP_HIGHEST_PERF(cap); in __intel_pstate_get_hwp_cap()
953 int scaling = cpu->pstate.scaling; in intel_pstate_get_hwp_cap()
957 cpu->pstate.max_freq = cpu->pstate.max_pstate * scaling; in intel_pstate_get_hwp_cap()
958 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * scaling; in intel_pstate_get_hwp_cap()
959 if (scaling != cpu->pstate.perf_ctl_scaling) { in intel_pstate_get_hwp_cap()
960 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_get_hwp_cap()
962 cpu->pstate.max_freq = rounddown(cpu->pstate.max_freq, in intel_pstate_get_hwp_cap()
964 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_freq, in intel_pstate_get_hwp_cap()
972 int max, min; in intel_pstate_hwp_set() local
976 max = cpu_data->max_perf_ratio; in intel_pstate_hwp_set()
977 min = cpu_data->min_perf_ratio; in intel_pstate_hwp_set()
979 if (cpu_data->policy == CPUFREQ_POLICY_PERFORMANCE) in intel_pstate_hwp_set()
980 min = max; in intel_pstate_hwp_set()
985 value |= HWP_MIN_PERF(min); in intel_pstate_hwp_set()
990 if (cpu_data->epp_policy == cpu_data->policy) in intel_pstate_hwp_set()
993 cpu_data->epp_policy = cpu_data->policy; in intel_pstate_hwp_set()
995 if (cpu_data->policy == CPUFREQ_POLICY_PERFORMANCE) { in intel_pstate_hwp_set()
997 cpu_data->epp_powersave = epp; in intel_pstate_hwp_set()
1005 if (cpu_data->epp_powersave < 0) in intel_pstate_hwp_set()
1011 * - Policy is not changed in intel_pstate_hwp_set()
1012 * - user has manually changed in intel_pstate_hwp_set()
1013 * - Error reading EPB in intel_pstate_hwp_set()
1019 epp = cpu_data->epp_powersave; in intel_pstate_hwp_set()
1028 WRITE_ONCE(cpu_data->hwp_req_cached, value); in intel_pstate_hwp_set()
1036 u64 value = READ_ONCE(cpu->hwp_req_cached); in intel_pstate_hwp_offline()
1048 value |= HWP_ENERGY_PERF_PREFERENCE(cpu->epp_cached); in intel_pstate_hwp_offline()
1054 cpu->epp_policy = CPUFREQ_POLICY_UNKNOWN; in intel_pstate_hwp_offline()
1063 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_pstate_hwp_offline()
1066 min_perf = HWP_LOWEST_PERF(READ_ONCE(cpu->hwp_cap_cached)); in intel_pstate_hwp_offline()
1072 /* Set EPP to min */ in intel_pstate_hwp_offline()
1076 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_pstate_hwp_offline()
1106 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, READ_ONCE(cpu->hwp_req_cached)); in intel_pstate_hwp_reenable()
1111 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_suspend()
1113 pr_debug("CPU %d suspending\n", cpu->cpu); in intel_pstate_suspend()
1115 cpu->suspended = true; in intel_pstate_suspend()
1125 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_resume()
1127 pr_debug("CPU %d resuming\n", cpu->cpu); in intel_pstate_resume()
1135 if (cpu->suspended && hwp_active) { in intel_pstate_resume()
1138 /* Re-enable HWP, because "online" has not done that. */ in intel_pstate_resume()
1144 cpu->suspended = false; in intel_pstate_resume()
1160 policy->cpuinfo.max_freq = global.turbo_disabled_mf ? in __intel_pstate_update_max_freq()
1161 cpudata->pstate.max_freq : cpudata->pstate.turbo_freq; in __intel_pstate_update_max_freq()
1228 ret = intel_pstate_update_status(buf, p ? p - buf : count); in store_status()
1245 return -EAGAIN; in show_turbo_pct()
1250 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1251 no_turbo = cpu->pstate.max_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1253 turbo_pct = 100 - fp_toint(mul_fp(turbo_fp, int_tofp(100))); in show_turbo_pct()
1270 return -EAGAIN; in show_num_pstates()
1274 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_num_pstates()
1290 return -EAGAIN; in show_no_turbo()
1312 return -EINVAL; in store_no_turbo()
1318 return -EAGAIN; in store_no_turbo()
1328 return -EPERM; in store_no_turbo()
1335 int pct = cpu->pstate.max_pstate * 100 / cpu->pstate.turbo_pstate; in store_no_turbo()
1366 req = policy->driver_data; in update_qos_request()
1382 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * perf_pct, 100); in update_qos_request()
1397 return -EINVAL; in store_max_perf_pct()
1403 return -EAGAIN; in store_max_perf_pct()
1430 return -EINVAL; in store_min_perf_pct()
1436 return -EAGAIN; in store_min_perf_pct()
1539 intel_pstate_kobject = kobject_create_and_add("intel_pstate", &dev_root->kobj); in intel_pstate_sysfs_expose_params()
1624 struct cpufreq_policy *policy = cpufreq_cpu_acquire(cpudata->cpu); in intel_pstate_notify_work()
1633 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_STATUS, 0); in intel_pstate_notify_work()
1675 schedule_delayed_work(&cpudata->hwp_notify_work, msecs_to_jiffies(10)); in notify_hwp_interrupt()
1694 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x00); in intel_pstate_disable_hwp_interrupt()
1697 if (cpumask_test_and_clear_cpu(cpudata->cpu, &hwp_intr_enable_mask)) in intel_pstate_disable_hwp_interrupt()
1698 cancel_delayed_work(&cpudata->hwp_notify_work); in intel_pstate_disable_hwp_interrupt()
1709 INIT_DELAYED_WORK(&cpudata->hwp_notify_work, intel_pstate_notify_work); in intel_pstate_enable_hwp_interrupt()
1710 cpumask_set_cpu(cpudata->cpu, &hwp_intr_enable_mask); in intel_pstate_enable_hwp_interrupt()
1714 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x01); in intel_pstate_enable_hwp_interrupt()
1715 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_STATUS, 0); in intel_pstate_enable_hwp_interrupt()
1721 cpudata->epp_default = intel_pstate_get_epp(cpudata, 0); in intel_pstate_update_epp_defaults()
1732 * - Is equal or less than 0x80 (default balance_perf EPP) in intel_pstate_update_epp_defaults()
1733 * - But less performance oriented than performance EPP in intel_pstate_update_epp_defaults()
1736 if (hwp_forced && cpudata->epp_default <= HWP_EPP_BALANCE_PERFORMANCE && in intel_pstate_update_epp_defaults()
1737 cpudata->epp_default > HWP_EPP_PERFORMANCE) { in intel_pstate_update_epp_defaults()
1738 epp_values[EPP_INDEX_BALANCE_PERFORMANCE] = cpudata->epp_default; in intel_pstate_update_epp_defaults()
1746 cpudata->epp_default = epp_values[EPP_INDEX_BALANCE_PERFORMANCE]; in intel_pstate_update_epp_defaults()
1747 intel_pstate_set_epp(cpudata, cpudata->epp_default); in intel_pstate_update_epp_defaults()
1754 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x00); in intel_pstate_hwp_enable()
1756 wrmsrl_on_cpu(cpudata->cpu, MSR_PM_ENABLE, 0x1); in intel_pstate_hwp_enable()
1760 if (cpudata->epp_default >= 0) in intel_pstate_hwp_enable()
1800 vid_fp = cpudata->vid.min + mul_fp( in atom_get_val()
1801 int_tofp(pstate - cpudata->pstate.min_pstate), in atom_get_val()
1802 cpudata->vid.ratio); in atom_get_val()
1804 vid_fp = clamp_t(int32_t, vid_fp, cpudata->vid.min, cpudata->vid.max); in atom_get_val()
1807 if (pstate > cpudata->pstate.max_pstate) in atom_get_val()
1808 vid = cpudata->vid.turbo; in atom_get_val()
1817 /* Defined in Table 35-6 from SDM (Sept 2015) */ in silvermont_get_scaling()
1832 /* Defined in Table 35-10 from SDM (Sept 2015) */ in airmont_get_scaling()
1849 cpudata->vid.min = int_tofp((value >> 8) & 0x7f); in atom_get_vid()
1850 cpudata->vid.max = int_tofp((value >> 16) & 0x7f); in atom_get_vid()
1851 cpudata->vid.ratio = div_fp( in atom_get_vid()
1852 cpudata->vid.max - cpudata->vid.min, in atom_get_vid()
1853 int_tofp(cpudata->pstate.max_pstate - in atom_get_vid()
1854 cpudata->pstate.min_pstate)); in atom_get_vid()
1857 cpudata->vid.turbo = value & 0x7f; in atom_get_vid()
1906 return -ENXIO; in core_get_tdp_ratio()
1935 if (tdp_ratio - 1 == tar_levels) { in core_get_max_pstate()
1998 /* P-cores have a smaller perf level-to-freqency scaling factor. */ in hwp_get_cpu_scaling()
2002 /* Use default core scaling for E-cores */ in hwp_get_cpu_scaling()
2007 * If reached here, this system is either non-hybrid (like Tiger in hwp_get_cpu_scaling()
2008 * Lake) or hybrid-capable (like Alder Lake or Raptor Lake) with in hwp_get_cpu_scaling()
2011 * The CPPC nominal_frequency field is 0 for non-hybrid systems, in hwp_get_cpu_scaling()
2019 trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_set_pstate()
2020 cpu->pstate.current_pstate = pstate; in intel_pstate_set_pstate()
2026 wrmsrl_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL, in intel_pstate_set_pstate()
2032 intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); in intel_pstate_set_min_pstate()
2037 int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); in intel_pstate_max_within_limits()
2045 int perf_ctl_max_phys = pstate_funcs.get_max_physical(cpu->cpu); in intel_pstate_get_cpu_pstates()
2048 cpu->pstate.min_pstate = pstate_funcs.get_min(cpu->cpu); in intel_pstate_get_cpu_pstates()
2049 cpu->pstate.max_pstate_physical = perf_ctl_max_phys; in intel_pstate_get_cpu_pstates()
2050 cpu->pstate.perf_ctl_scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2056 cpu->pstate.scaling = pstate_funcs.get_cpu_scaling(cpu->cpu); in intel_pstate_get_cpu_pstates()
2057 if (cpu->pstate.scaling != perf_ctl_scaling) in intel_pstate_get_cpu_pstates()
2060 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2063 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2064 cpu->pstate.max_pstate = pstate_funcs.get_max(cpu->cpu); in intel_pstate_get_cpu_pstates()
2065 cpu->pstate.turbo_pstate = pstate_funcs.get_turbo(cpu->cpu); in intel_pstate_get_cpu_pstates()
2068 if (cpu->pstate.scaling == perf_ctl_scaling) { in intel_pstate_get_cpu_pstates()
2069 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2070 cpu->pstate.max_freq = cpu->pstate.max_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2071 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2075 cpu->aperf_mperf_shift = pstate_funcs.get_aperf_mperf_shift(); in intel_pstate_get_cpu_pstates()
2084 * Long hold time will keep high perf limits for long time,
2093 u64 hwp_req = READ_ONCE(cpu->hwp_req_cached); in intel_pstate_hwp_boost_up()
2094 u64 hwp_cap = READ_ONCE(cpu->hwp_cap_cached); in intel_pstate_hwp_boost_up()
2100 * Cases to consider (User changes via sysfs or boot time): in intel_pstate_hwp_boost_up()
2101 * If, P0 (Turbo max) = P1 (Guaranteed max) = min: in intel_pstate_hwp_boost_up()
2103 * If, P0 (Turbo max) > P1 (Guaranteed max) = min: in intel_pstate_hwp_boost_up()
2105 * If, P0 (Turbo max) = P1 (Guaranteed max) > min: in intel_pstate_hwp_boost_up()
2107 * (min + p1)/2 and P1. in intel_pstate_hwp_boost_up()
2108 * If, P0 (Turbo max) > P1 (Guaranteed max) > min: in intel_pstate_hwp_boost_up()
2110 * (min + p1)/2, P1 and P0. in intel_pstate_hwp_boost_up()
2113 /* If max and min are equal or already at max, nothing to boost */ in intel_pstate_hwp_boost_up()
2114 if (max_limit == min_limit || cpu->hwp_boost_min >= max_limit) in intel_pstate_hwp_boost_up()
2117 if (!cpu->hwp_boost_min) in intel_pstate_hwp_boost_up()
2118 cpu->hwp_boost_min = min_limit; in intel_pstate_hwp_boost_up()
2120 /* level at half way mark between min and guranteed */ in intel_pstate_hwp_boost_up()
2123 if (cpu->hwp_boost_min < boost_level1) in intel_pstate_hwp_boost_up()
2124 cpu->hwp_boost_min = boost_level1; in intel_pstate_hwp_boost_up()
2125 else if (cpu->hwp_boost_min < HWP_GUARANTEED_PERF(hwp_cap)) in intel_pstate_hwp_boost_up()
2126 cpu->hwp_boost_min = HWP_GUARANTEED_PERF(hwp_cap); in intel_pstate_hwp_boost_up()
2127 else if (cpu->hwp_boost_min == HWP_GUARANTEED_PERF(hwp_cap) && in intel_pstate_hwp_boost_up()
2129 cpu->hwp_boost_min = max_limit; in intel_pstate_hwp_boost_up()
2133 hwp_req = (hwp_req & ~GENMASK_ULL(7, 0)) | cpu->hwp_boost_min; in intel_pstate_hwp_boost_up()
2135 cpu->last_update = cpu->sample.time; in intel_pstate_hwp_boost_up()
2140 if (cpu->hwp_boost_min) { in intel_pstate_hwp_boost_down()
2143 /* Check if we are idle for hold time to boost down */ in intel_pstate_hwp_boost_down()
2144 expired = time_after64(cpu->sample.time, cpu->last_update + in intel_pstate_hwp_boost_down()
2147 wrmsrl(MSR_HWP_REQUEST, cpu->hwp_req_cached); in intel_pstate_hwp_boost_down()
2148 cpu->hwp_boost_min = 0; in intel_pstate_hwp_boost_down()
2151 cpu->last_update = cpu->sample.time; in intel_pstate_hwp_boost_down()
2155 u64 time) in intel_pstate_update_util_hwp_local() argument
2157 cpu->sample.time = time; in intel_pstate_update_util_hwp_local()
2159 if (cpu->sched_flags & SCHED_CPUFREQ_IOWAIT) { in intel_pstate_update_util_hwp_local()
2162 cpu->sched_flags = 0; in intel_pstate_update_util_hwp_local()
2164 * Set iowait_boost flag and update time. Since IO WAIT flag in intel_pstate_update_util_hwp_local()
2165 * is set all the time, we can't just conclude that there is in intel_pstate_update_util_hwp_local()
2170 if (time_before64(time, cpu->last_io_update + 2 * TICK_NSEC)) in intel_pstate_update_util_hwp_local()
2173 cpu->last_io_update = time; in intel_pstate_update_util_hwp_local()
2184 u64 time, unsigned int flags) in intel_pstate_update_util_hwp() argument
2188 cpu->sched_flags |= flags; in intel_pstate_update_util_hwp()
2190 if (smp_processor_id() == cpu->cpu) in intel_pstate_update_util_hwp()
2191 intel_pstate_update_util_hwp_local(cpu, time); in intel_pstate_update_util_hwp()
2196 struct sample *sample = &cpu->sample; in intel_pstate_calc_avg_perf() local
2198 sample->core_avg_perf = div_ext_fp(sample->aperf, sample->mperf); in intel_pstate_calc_avg_perf()
2201 static inline bool intel_pstate_sample(struct cpudata *cpu, u64 time) in intel_pstate_sample() argument
2211 if (cpu->prev_mperf == mperf || cpu->prev_tsc == tsc) { in intel_pstate_sample()
2217 cpu->last_sample_time = cpu->sample.time; in intel_pstate_sample()
2218 cpu->sample.time = time; in intel_pstate_sample()
2219 cpu->sample.aperf = aperf; in intel_pstate_sample()
2220 cpu->sample.mperf = mperf; in intel_pstate_sample()
2221 cpu->sample.tsc = tsc; in intel_pstate_sample()
2222 cpu->sample.aperf -= cpu->prev_aperf; in intel_pstate_sample()
2223 cpu->sample.mperf -= cpu->prev_mperf; in intel_pstate_sample()
2224 cpu->sample.tsc -= cpu->prev_tsc; in intel_pstate_sample()
2226 cpu->prev_aperf = aperf; in intel_pstate_sample()
2227 cpu->prev_mperf = mperf; in intel_pstate_sample()
2228 cpu->prev_tsc = tsc; in intel_pstate_sample()
2230 * First time this function is invoked in a given cycle, all of the in intel_pstate_sample()
2231 * previous sample data fields are equal to zero or stale and they must in intel_pstate_sample()
2233 * that sample.time will always be reset before setting the utilization in intel_pstate_sample()
2234 * update hook and make the caller skip the sample then. in intel_pstate_sample()
2236 if (cpu->last_sample_time) { in intel_pstate_sample()
2245 return mul_ext_fp(cpu->sample.core_avg_perf, cpu_khz); in get_avg_frequency()
2250 return mul_ext_fp(cpu->pstate.max_pstate_physical, in get_avg_pstate()
2251 cpu->sample.core_avg_perf); in get_avg_pstate()
2256 struct sample *sample = &cpu->sample; in get_target_pstate() local
2260 busy_frac = div_fp(sample->mperf << cpu->aperf_mperf_shift, in get_target_pstate()
2261 sample->tsc); in get_target_pstate()
2263 if (busy_frac < cpu->iowait_boost) in get_target_pstate()
2264 busy_frac = cpu->iowait_boost; in get_target_pstate()
2266 sample->busy_scaled = busy_frac * 100; in get_target_pstate()
2269 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; in get_target_pstate()
2272 if (target < cpu->pstate.min_pstate) in get_target_pstate()
2273 target = cpu->pstate.min_pstate; in get_target_pstate()
2276 * If the average P-state during the previous cycle was higher than the in get_target_pstate()
2284 target += (avg_pstate - target) >> 1; in get_target_pstate()
2291 int min_pstate = max(cpu->pstate.min_pstate, cpu->min_perf_ratio); in intel_pstate_prepare_request()
2292 int max_pstate = max(min_pstate, cpu->max_perf_ratio); in intel_pstate_prepare_request()
2299 if (pstate == cpu->pstate.current_pstate) in intel_pstate_update_pstate()
2302 cpu->pstate.current_pstate = pstate; in intel_pstate_update_pstate()
2308 int from = cpu->pstate.current_pstate; in intel_pstate_adjust_pstate()
2309 struct sample *sample; in intel_pstate_adjust_pstate() local
2316 trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_adjust_pstate()
2319 sample = &cpu->sample; in intel_pstate_adjust_pstate()
2320 trace_pstate_sample(mul_ext_fp(100, sample->core_avg_perf), in intel_pstate_adjust_pstate()
2321 fp_toint(sample->busy_scaled), in intel_pstate_adjust_pstate()
2323 cpu->pstate.current_pstate, in intel_pstate_adjust_pstate()
2324 sample->mperf, in intel_pstate_adjust_pstate()
2325 sample->aperf, in intel_pstate_adjust_pstate()
2326 sample->tsc, in intel_pstate_adjust_pstate()
2328 fp_toint(cpu->iowait_boost * 100)); in intel_pstate_adjust_pstate()
2331 static void intel_pstate_update_util(struct update_util_data *data, u64 time, in intel_pstate_update_util() argument
2338 if (smp_processor_id() != cpu->cpu) in intel_pstate_update_util()
2341 delta_ns = time - cpu->last_update; in intel_pstate_update_util()
2345 cpu->iowait_boost = ONE_EIGHTH_FP; in intel_pstate_update_util()
2346 } else if (cpu->iowait_boost >= ONE_EIGHTH_FP) { in intel_pstate_update_util()
2347 cpu->iowait_boost <<= 1; in intel_pstate_update_util()
2348 if (cpu->iowait_boost > int_tofp(1)) in intel_pstate_update_util()
2349 cpu->iowait_boost = int_tofp(1); in intel_pstate_update_util()
2351 cpu->iowait_boost = ONE_EIGHTH_FP; in intel_pstate_update_util()
2353 } else if (cpu->iowait_boost) { in intel_pstate_update_util()
2356 cpu->iowait_boost = 0; in intel_pstate_update_util()
2358 cpu->iowait_boost >>= 1; in intel_pstate_update_util()
2360 cpu->last_update = time; in intel_pstate_update_util()
2361 delta_ns = time - cpu->sample.time; in intel_pstate_update_util()
2365 if (intel_pstate_sample(cpu, time)) in intel_pstate_update_util()
2465 return -ENOMEM; in intel_pstate_init_cpu()
2469 cpu->cpu = cpunum; in intel_pstate_init_cpu()
2471 cpu->epp_default = -EINVAL; in intel_pstate_init_cpu()
2481 * Re-enable HWP in case this happens after a resume from ACPI in intel_pstate_init_cpu()
2488 cpu->epp_powersave = -EINVAL; in intel_pstate_init_cpu()
2489 cpu->epp_policy = 0; in intel_pstate_init_cpu()
2505 if (cpu->update_util_set) in intel_pstate_set_update_util_hook()
2509 cpu->sample.time = 0; in intel_pstate_set_update_util_hook()
2510 cpufreq_add_update_util_hook(cpu_num, &cpu->update_util, in intel_pstate_set_update_util_hook()
2514 cpu->update_util_set = true; in intel_pstate_set_update_util_hook()
2521 if (!cpu_data->update_util_set) in intel_pstate_clear_update_util_hook()
2525 cpu_data->update_util_set = false; in intel_pstate_clear_update_util_hook()
2532 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_get_max_freq()
2539 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_update_perf_limits()
2555 if (hwp_active && cpu->pstate.scaling != perf_ctl_scaling) { in intel_pstate_update_perf_limits()
2565 cpu->cpu, min_policy_perf, max_policy_perf); in intel_pstate_update_perf_limits()
2569 cpu->min_perf_ratio = min_policy_perf; in intel_pstate_update_perf_limits()
2570 cpu->max_perf_ratio = max_policy_perf; in intel_pstate_update_perf_limits()
2572 int turbo_max = cpu->pstate.turbo_pstate; in intel_pstate_update_perf_limits()
2575 /* Global limits are in percent of the maximum turbo P-state. */ in intel_pstate_update_perf_limits()
2580 pr_debug("cpu:%d global_min:%d global_max:%d\n", cpu->cpu, in intel_pstate_update_perf_limits()
2583 cpu->min_perf_ratio = max(min_policy_perf, global_min); in intel_pstate_update_perf_limits()
2584 cpu->min_perf_ratio = min(cpu->min_perf_ratio, max_policy_perf); in intel_pstate_update_perf_limits()
2585 cpu->max_perf_ratio = min(max_policy_perf, global_max); in intel_pstate_update_perf_limits()
2586 cpu->max_perf_ratio = max(min_policy_perf, cpu->max_perf_ratio); in intel_pstate_update_perf_limits()
2589 cpu->min_perf_ratio = min(cpu->min_perf_ratio, in intel_pstate_update_perf_limits()
2590 cpu->max_perf_ratio); in intel_pstate_update_perf_limits()
2593 pr_debug("cpu:%d max_perf_ratio:%d min_perf_ratio:%d\n", cpu->cpu, in intel_pstate_update_perf_limits()
2594 cpu->max_perf_ratio, in intel_pstate_update_perf_limits()
2595 cpu->min_perf_ratio); in intel_pstate_update_perf_limits()
2602 if (!policy->cpuinfo.max_freq) in intel_pstate_set_policy()
2603 return -ENODEV; in intel_pstate_set_policy()
2605 pr_debug("set_policy cpuinfo.max %u policy->max %u\n", in intel_pstate_set_policy()
2606 policy->cpuinfo.max_freq, policy->max); in intel_pstate_set_policy()
2608 cpu = all_cpu_data[policy->cpu]; in intel_pstate_set_policy()
2609 cpu->policy = policy->policy; in intel_pstate_set_policy()
2613 intel_pstate_update_perf_limits(cpu, policy->min, policy->max); in intel_pstate_set_policy()
2615 if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) { in intel_pstate_set_policy()
2620 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2623 intel_pstate_set_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2633 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2634 intel_pstate_hwp_set(policy->cpu); in intel_pstate_set_policy()
2637 * policy->cur is never updated with the intel_pstate driver, but it in intel_pstate_set_policy()
2640 policy->cur = policy->min; in intel_pstate_set_policy()
2651 cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate && in intel_pstate_adjust_policy_max()
2652 policy->max < policy->cpuinfo.max_freq && in intel_pstate_adjust_policy_max()
2653 policy->max > cpu->pstate.max_freq) { in intel_pstate_adjust_policy_max()
2654 pr_debug("policy->max > max non turbo frequency\n"); in intel_pstate_adjust_policy_max()
2655 policy->max = policy->cpuinfo.max_freq; in intel_pstate_adjust_policy_max()
2668 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_verify_cpu_policy()
2672 cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, max_freq); in intel_pstate_verify_cpu_policy()
2679 intel_pstate_verify_cpu_policy(all_cpu_data[policy->cpu], policy); in intel_pstate_verify_policy()
2686 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_cpu_offline()
2688 pr_debug("CPU %d going offline\n", cpu->cpu); in intel_cpufreq_cpu_offline()
2690 if (cpu->suspended) in intel_cpufreq_cpu_offline()
2711 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_cpu_online()
2713 pr_debug("CPU %d going online\n", cpu->cpu); in intel_pstate_cpu_online()
2719 * Re-enable HWP and clear the "suspended" flag to let "resume" in intel_pstate_cpu_online()
2723 cpu->suspended = false; in intel_pstate_cpu_online()
2731 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_cpu_offline()
2738 pr_debug("CPU %d exiting\n", policy->cpu); in intel_pstate_cpu_exit()
2740 policy->fast_switch_possible = false; in intel_pstate_cpu_exit()
2750 rc = intel_pstate_init_cpu(policy->cpu); in __intel_pstate_cpu_init()
2754 cpu = all_cpu_data[policy->cpu]; in __intel_pstate_cpu_init()
2756 cpu->max_perf_ratio = 0xFF; in __intel_pstate_cpu_init()
2757 cpu->min_perf_ratio = 0; in __intel_pstate_cpu_init()
2760 policy->cpuinfo.min_freq = cpu->pstate.min_freq; in __intel_pstate_cpu_init()
2763 policy->cpuinfo.max_freq = global.turbo_disabled ? in __intel_pstate_cpu_init()
2764 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in __intel_pstate_cpu_init()
2766 policy->min = policy->cpuinfo.min_freq; in __intel_pstate_cpu_init()
2767 policy->max = policy->cpuinfo.max_freq; in __intel_pstate_cpu_init()
2771 policy->fast_switch_possible = true; in __intel_pstate_cpu_init()
2787 policy->policy = CPUFREQ_POLICY_POWERSAVE; in intel_pstate_cpu_init()
2790 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_cpu_init()
2792 cpu->epp_cached = intel_pstate_get_epp(cpu, 0); in intel_pstate_cpu_init()
2814 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_verify_policy()
2817 intel_pstate_update_perf_limits(cpu, policy->min, policy->max); in intel_cpufreq_verify_policy()
2826 * core_avg_perf) is not needed and so is re-assigned to indicate if the
2829 * (or performance or core_avg_perf) have a fixed y-axis from 0 to 100%,
2840 struct sample *sample; in intel_cpufreq_trace() local
2848 sample = &cpu->sample; in intel_cpufreq_trace()
2852 cpu->pstate.current_pstate, in intel_cpufreq_trace()
2853 sample->mperf, in intel_cpufreq_trace()
2854 sample->aperf, in intel_cpufreq_trace()
2855 sample->tsc, in intel_cpufreq_trace()
2857 fp_toint(cpu->iowait_boost * 100)); in intel_cpufreq_trace()
2860 static void intel_cpufreq_hwp_update(struct cpudata *cpu, u32 min, u32 max, in intel_cpufreq_hwp_update() argument
2863 u64 prev = READ_ONCE(cpu->hwp_req_cached), value = prev; in intel_cpufreq_hwp_update()
2866 value |= HWP_MIN_PERF(min); in intel_cpufreq_hwp_update()
2877 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_cpufreq_hwp_update()
2881 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_cpufreq_hwp_update()
2891 wrmsrl_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL, in intel_cpufreq_perf_ctl_update()
2898 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_update_pstate()
2899 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_update_pstate()
2903 int max_pstate = policy->strict_target ? in intel_cpufreq_update_pstate()
2904 target_pstate : cpu->max_perf_ratio; in intel_cpufreq_update_pstate()
2912 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_update_pstate()
2924 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_target()
2930 freqs.old = policy->cur; in intel_cpufreq_target()
2938 freqs.new = target_pstate * cpu->pstate.scaling; in intel_cpufreq_target()
2948 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_fast_switch()
2957 return target_pstate * cpu->pstate.scaling; in intel_cpufreq_fast_switch()
2966 u64 hwp_cap = READ_ONCE(cpu->hwp_cap_cached); in intel_cpufreq_adjust_perf()
2967 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_adjust_perf()
2984 if (min_pstate < cpu->pstate.min_pstate) in intel_cpufreq_adjust_perf()
2985 min_pstate = cpu->pstate.min_pstate; in intel_cpufreq_adjust_perf()
2987 if (min_pstate < cpu->min_perf_ratio) in intel_cpufreq_adjust_perf()
2988 min_pstate = cpu->min_perf_ratio; in intel_cpufreq_adjust_perf()
2990 if (min_pstate > cpu->max_perf_ratio) in intel_cpufreq_adjust_perf()
2991 min_pstate = cpu->max_perf_ratio; in intel_cpufreq_adjust_perf()
2993 max_pstate = min(cap_pstate, cpu->max_perf_ratio); in intel_cpufreq_adjust_perf()
3001 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_adjust_perf()
3012 dev = get_cpu_device(policy->cpu); in intel_cpufreq_cpu_init()
3014 return -ENODEV; in intel_cpufreq_cpu_init()
3020 policy->cpuinfo.transition_latency = INTEL_CPUFREQ_TRANSITION_LATENCY; in intel_cpufreq_cpu_init()
3022 policy->cur = policy->cpuinfo.min_freq; in intel_cpufreq_cpu_init()
3026 ret = -ENOMEM; in intel_cpufreq_cpu_init()
3030 cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_cpu_init()
3035 policy->transition_delay_us = INTEL_CPUFREQ_TRANSITION_DELAY_HWP; in intel_cpufreq_cpu_init()
3039 rdmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, &value); in intel_cpufreq_cpu_init()
3040 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_cpufreq_cpu_init()
3042 cpu->epp_cached = intel_pstate_get_epp(cpu, value); in intel_cpufreq_cpu_init()
3044 policy->transition_delay_us = INTEL_CPUFREQ_TRANSITION_DELAY; in intel_cpufreq_cpu_init()
3047 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.min_perf_pct, 100); in intel_cpufreq_cpu_init()
3049 ret = freq_qos_add_request(&policy->constraints, req, FREQ_QOS_MIN, in intel_cpufreq_cpu_init()
3052 dev_err(dev, "Failed to add min-freq constraint (%d)\n", ret); in intel_cpufreq_cpu_init()
3056 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.max_perf_pct, 100); in intel_cpufreq_cpu_init()
3058 ret = freq_qos_add_request(&policy->constraints, req + 1, FREQ_QOS_MAX, in intel_cpufreq_cpu_init()
3061 dev_err(dev, "Failed to add max-freq constraint (%d)\n", ret); in intel_cpufreq_cpu_init()
3065 policy->driver_data = req; in intel_cpufreq_cpu_init()
3083 req = policy->driver_data; in intel_cpufreq_cpu_exit()
3097 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_suspend()
3098 u64 value = READ_ONCE(cpu->hwp_req_cached); in intel_cpufreq_suspend()
3106 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_cpufreq_suspend()
3107 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_cpufreq_suspend()
3186 return -EINVAL; in intel_pstate_update_status()
3189 return -EBUSY; in intel_pstate_update_status()
3219 return -EINVAL; in intel_pstate_update_status()
3232 return -ENODEV; in intel_pstate_msrs_not_valid()
3239 pstate_funcs.get_max = funcs->get_max; in copy_cpu_funcs()
3240 pstate_funcs.get_max_physical = funcs->get_max_physical; in copy_cpu_funcs()
3241 pstate_funcs.get_min = funcs->get_min; in copy_cpu_funcs()
3242 pstate_funcs.get_turbo = funcs->get_turbo; in copy_cpu_funcs()
3243 pstate_funcs.get_scaling = funcs->get_scaling; in copy_cpu_funcs()
3244 pstate_funcs.get_val = funcs->get_val; in copy_cpu_funcs()
3245 pstate_funcs.get_vid = funcs->get_vid; in copy_cpu_funcs()
3246 pstate_funcs.get_aperf_mperf_shift = funcs->get_aperf_mperf_shift; in copy_cpu_funcs()
3264 status = acpi_evaluate_object(pr->handle, "_PSS", NULL, &buffer); in intel_pstate_no_acpi_pss()
3269 if (pss && pss->type == ACPI_TYPE_PACKAGE) { in intel_pstate_no_acpi_pss()
3307 if (acpi_has_method(pr->handle, "_PPC")) in intel_pstate_has_acpi_ppc()
3319 /* Hardware vendor-specific info that has its own power management modes */
3322 {"ORACLE", "X4-2 ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3323 {"ORACLE", "X4-2L ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3324 {"ORACLE", "X4-2B ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3325 {"ORACLE", "X3-2 ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3326 {"ORACLE", "X3-2L ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3327 {"ORACLE", "X3-2B ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3334 {"ORACLE", "X6-2 ", 0, ACPI_SIG_FADT, all_versions, NULL, PPC},
3377 * It may be unsafe to request P-states control from SMM if _PPC support in intel_pstate_request_control_from_smm()
3428 return -ENODEV; in intel_pstate_init()
3437 return -ENODEV; in intel_pstate_init()
3450 hwp_mode_bdw = id->driver_data; in intel_pstate_init()
3465 return -ENODEV; in intel_pstate_init()
3470 return -ENODEV; in intel_pstate_init()
3473 copy_cpu_funcs((struct pstate_funcs *)id->driver_data); in intel_pstate_init()
3478 return -ENODEV; in intel_pstate_init()
3490 pr_info("P-states controlled by the platform\n"); in intel_pstate_init()
3491 return -ENODEV; in intel_pstate_init()
3495 return -ENOTSUPP; in intel_pstate_init()
3497 pr_info("Intel P-state driver initializing\n"); in intel_pstate_init()
3501 return -ENOMEM; in intel_pstate_init()
3513 epp_values[EPP_INDEX_BALANCE_PERFORMANCE] = id->driver_data; in intel_pstate_init()
3545 return -EINVAL; in intel_pstate_setup()
3574 MODULE_DESCRIPTION("'intel_pstate' - P state driver Intel Core processors");