Lines Matching full:cpu

20 #include <linux/cpu.h>
30 #include <asm/cpu.h>
97 * to account for cpu idle period
133 * Stores the per cpu model P state limits and current P state.
190 * struct cpudata - Per CPU instance data storage
191 * @cpu: CPU number for this instance data
197 * @pstate: Stores P state limits for this CPU
198 * @vid: Stores VID limits for this CPU
221 * @sched_flags: Store scheduler flags for possible cross CPU update
226 * This structure stores per CPU instance data for all CPUs.
229 int cpu; member
269 * struct pstate_funcs - Per CPU model specific callbacks
275 * @get_cpu_scaling: Get frequency scaling factor for a given cpu
280 * Core and Atom CPU models have different way to get P State limits. This
284 int (*get_max)(int cpu);
285 int (*get_max_physical)(int cpu);
286 int (*get_min)(int cpu);
287 int (*get_turbo)(int cpu);
289 int (*get_cpu_scaling)(int cpu);
334 /* The work item is needed to avoid CPU hotplug locking issues */
344 static void intel_pstate_set_itmt_prio(int cpu) in intel_pstate_set_itmt_prio() argument
350 ret = cppc_get_perf_caps(cpu, &cppc_perf); in intel_pstate_set_itmt_prio()
360 cppc_perf.highest_perf = HWP_HIGHEST_PERF(READ_ONCE(all_cpu_data[cpu]->hwp_cap_cached)); in intel_pstate_set_itmt_prio()
367 sched_set_itmt_core_prio(cppc_perf.highest_perf, cpu); in intel_pstate_set_itmt_prio()
378 * This code can be run during CPU online under the in intel_pstate_set_itmt_prio()
379 * CPU hotplug locks, so sched_set_itmt_support() in intel_pstate_set_itmt_prio()
388 static int intel_pstate_get_cppc_guaranteed(int cpu) in intel_pstate_get_cppc_guaranteed() argument
393 ret = cppc_get_perf_caps(cpu, &cppc_perf); in intel_pstate_get_cppc_guaranteed()
403 static inline void intel_pstate_set_itmt_prio(int cpu) in intel_pstate_set_itmt_prio() argument
410 struct cpudata *cpu; in intel_pstate_init_acpi_perf_limits() local
415 intel_pstate_set_itmt_prio(policy->cpu); in intel_pstate_init_acpi_perf_limits()
422 cpu = all_cpu_data[policy->cpu]; in intel_pstate_init_acpi_perf_limits()
424 ret = acpi_processor_register_performance(&cpu->acpi_perf_data, in intel_pstate_init_acpi_perf_limits()
425 policy->cpu); in intel_pstate_init_acpi_perf_limits()
434 if (cpu->acpi_perf_data.control_register.space_id != in intel_pstate_init_acpi_perf_limits()
442 if (cpu->acpi_perf_data.state_count < 2) in intel_pstate_init_acpi_perf_limits()
445 pr_debug("CPU%u - ACPI _PSS perf data\n", policy->cpu); in intel_pstate_init_acpi_perf_limits()
446 for (i = 0; i < cpu->acpi_perf_data.state_count; i++) { in intel_pstate_init_acpi_perf_limits()
448 (i == cpu->acpi_perf_data.state ? '*' : ' '), i, in intel_pstate_init_acpi_perf_limits()
449 (u32) cpu->acpi_perf_data.states[i].core_frequency, in intel_pstate_init_acpi_perf_limits()
450 (u32) cpu->acpi_perf_data.states[i].power, in intel_pstate_init_acpi_perf_limits()
451 (u32) cpu->acpi_perf_data.states[i].control); in intel_pstate_init_acpi_perf_limits()
466 cpu->acpi_perf_data.states[0].core_frequency = in intel_pstate_init_acpi_perf_limits()
468 cpu->valid_pss_table = true; in intel_pstate_init_acpi_perf_limits()
474 cpu->valid_pss_table = false; in intel_pstate_init_acpi_perf_limits()
475 acpi_processor_unregister_performance(policy->cpu); in intel_pstate_init_acpi_perf_limits()
480 struct cpudata *cpu; in intel_pstate_exit_perf_limits() local
482 cpu = all_cpu_data[policy->cpu]; in intel_pstate_exit_perf_limits()
483 if (!cpu->valid_pss_table) in intel_pstate_exit_perf_limits()
486 acpi_processor_unregister_performance(policy->cpu); in intel_pstate_exit_perf_limits()
504 static inline int intel_pstate_get_cppc_guaranteed(int cpu) in intel_pstate_get_cppc_guaranteed() argument
512 * @cpu: Target CPU.
516 * scaling factor between HWP performance levels and CPU frequency will be less
517 * than the scaling factor between P-state values and CPU frequency.
519 * In that case, adjust the CPU parameters used in computations accordingly.
521 static void intel_pstate_hybrid_hwp_adjust(struct cpudata *cpu) in intel_pstate_hybrid_hwp_adjust() argument
523 int perf_ctl_max_phys = cpu->pstate.max_pstate_physical; in intel_pstate_hybrid_hwp_adjust()
524 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
525 int perf_ctl_turbo = pstate_funcs.get_turbo(cpu->cpu); in intel_pstate_hybrid_hwp_adjust()
526 int scaling = cpu->pstate.scaling; in intel_pstate_hybrid_hwp_adjust()
528 pr_debug("CPU%d: perf_ctl_max_phys = %d\n", cpu->cpu, perf_ctl_max_phys); in intel_pstate_hybrid_hwp_adjust()
529 pr_debug("CPU%d: perf_ctl_turbo = %d\n", cpu->cpu, perf_ctl_turbo); in intel_pstate_hybrid_hwp_adjust()
530 pr_debug("CPU%d: perf_ctl_scaling = %d\n", cpu->cpu, perf_ctl_scaling); in intel_pstate_hybrid_hwp_adjust()
531 pr_debug("CPU%d: HWP_CAP guaranteed = %d\n", cpu->cpu, cpu->pstate.max_pstate); in intel_pstate_hybrid_hwp_adjust()
532 pr_debug("CPU%d: HWP_CAP highest = %d\n", cpu->cpu, cpu->pstate.turbo_pstate); in intel_pstate_hybrid_hwp_adjust()
533 pr_debug("CPU%d: HWP-to-frequency scaling factor: %d\n", cpu->cpu, scaling); in intel_pstate_hybrid_hwp_adjust()
535 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
537 cpu->pstate.max_freq = rounddown(cpu->pstate.max_pstate * scaling, in intel_pstate_hybrid_hwp_adjust()
540 cpu->pstate.max_pstate_physical = in intel_pstate_hybrid_hwp_adjust()
544 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_hybrid_hwp_adjust()
549 cpu->pstate.min_pstate = DIV_ROUND_UP(cpu->pstate.min_freq, scaling); in intel_pstate_hybrid_hwp_adjust()
555 struct cpudata *cpu; in update_turbo_state() local
557 cpu = all_cpu_data[0]; in update_turbo_state()
561 cpu->pstate.max_pstate == cpu->pstate.turbo_pstate); in update_turbo_state()
566 struct cpudata *cpu = all_cpu_data[0]; in min_perf_pct_min() local
567 int turbo_pstate = cpu->pstate.turbo_pstate; in min_perf_pct_min()
570 (cpu->pstate.min_pstate * 100 / turbo_pstate) : 0; in min_perf_pct_min()
581 ret = rdmsrl_on_cpu(cpu_data->cpu, MSR_IA32_ENERGY_PERF_BIAS, &epb); in intel_pstate_get_epb()
598 epp = rdmsrl_on_cpu(cpu_data->cpu, MSR_HWP_REQUEST, in intel_pstate_get_epp()
612 static int intel_pstate_set_epb(int cpu, s16 pref) in intel_pstate_set_epb() argument
620 ret = rdmsrl_on_cpu(cpu, MSR_IA32_ENERGY_PERF_BIAS, &epb); in intel_pstate_set_epb()
625 wrmsrl_on_cpu(cpu, MSR_IA32_ENERGY_PERF_BIAS, epb); in intel_pstate_set_epb()
704 static int intel_pstate_set_epp(struct cpudata *cpu, u32 epp) in intel_pstate_set_epp() argument
713 u64 value = READ_ONCE(cpu->hwp_req_cached); in intel_pstate_set_epp()
722 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_pstate_set_epp()
723 ret = wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_pstate_set_epp()
725 cpu->epp_cached = epp; in intel_pstate_set_epp()
758 ret = intel_pstate_set_epb(cpu_data->cpu, epp); in intel_pstate_set_energy_pref_index()
785 struct cpudata *cpu = all_cpu_data[policy->cpu]; in store_energy_performance_preference() local
821 ret = intel_pstate_set_energy_pref_index(cpu, ret, raw, epp); in store_energy_performance_preference()
825 * target CPU before the EPP update and restarted after it, in store_energy_performance_preference()
830 epp = ret ? epp_values[ret] : cpu->epp_default; in store_energy_performance_preference()
832 if (cpu->epp_cached != epp) { in store_energy_performance_preference()
836 ret = intel_pstate_set_epp(cpu, epp); in store_energy_performance_preference()
851 struct cpudata *cpu_data = all_cpu_data[policy->cpu]; in show_energy_performance_preference()
868 struct cpudata *cpu = all_cpu_data[policy->cpu]; in show_base_frequency() local
871 ratio = intel_pstate_get_cppc_guaranteed(policy->cpu); in show_base_frequency()
875 rdmsrl_on_cpu(policy->cpu, MSR_HWP_CAPABILITIES, &cap); in show_base_frequency()
879 freq = ratio * cpu->pstate.scaling; in show_base_frequency()
880 if (cpu->pstate.scaling != cpu->pstate.perf_ctl_scaling) in show_base_frequency()
881 freq = rounddown(freq, cpu->pstate.perf_ctl_scaling); in show_base_frequency()
895 static void __intel_pstate_get_hwp_cap(struct cpudata *cpu) in __intel_pstate_get_hwp_cap() argument
899 rdmsrl_on_cpu(cpu->cpu, MSR_HWP_CAPABILITIES, &cap); in __intel_pstate_get_hwp_cap()
900 WRITE_ONCE(cpu->hwp_cap_cached, cap); in __intel_pstate_get_hwp_cap()
901 cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(cap); in __intel_pstate_get_hwp_cap()
902 cpu->pstate.turbo_pstate = HWP_HIGHEST_PERF(cap); in __intel_pstate_get_hwp_cap()
905 static void intel_pstate_get_hwp_cap(struct cpudata *cpu) in intel_pstate_get_hwp_cap() argument
907 int scaling = cpu->pstate.scaling; in intel_pstate_get_hwp_cap()
909 __intel_pstate_get_hwp_cap(cpu); in intel_pstate_get_hwp_cap()
911 cpu->pstate.max_freq = cpu->pstate.max_pstate * scaling; in intel_pstate_get_hwp_cap()
912 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * scaling; in intel_pstate_get_hwp_cap()
913 if (scaling != cpu->pstate.perf_ctl_scaling) { in intel_pstate_get_hwp_cap()
914 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_get_hwp_cap()
916 cpu->pstate.max_freq = rounddown(cpu->pstate.max_freq, in intel_pstate_get_hwp_cap()
918 cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_freq, in intel_pstate_get_hwp_cap()
923 static void intel_pstate_hwp_set(unsigned int cpu) in intel_pstate_hwp_set() argument
925 struct cpudata *cpu_data = all_cpu_data[cpu]; in intel_pstate_hwp_set()
936 rdmsrl_on_cpu(cpu, MSR_HWP_REQUEST, &value); in intel_pstate_hwp_set()
979 intel_pstate_set_epb(cpu, epp); in intel_pstate_hwp_set()
983 wrmsrl_on_cpu(cpu, MSR_HWP_REQUEST, value); in intel_pstate_hwp_set()
988 static void intel_pstate_hwp_offline(struct cpudata *cpu) in intel_pstate_hwp_offline() argument
990 u64 value = READ_ONCE(cpu->hwp_req_cached); in intel_pstate_hwp_offline()
993 intel_pstate_disable_hwp_interrupt(cpu); in intel_pstate_hwp_offline()
1002 value |= HWP_ENERGY_PERF_PREFERENCE(cpu->epp_cached); in intel_pstate_hwp_offline()
1005 * the CPU is brought back online again and the "performance" in intel_pstate_hwp_offline()
1008 cpu->epp_policy = CPUFREQ_POLICY_UNKNOWN; in intel_pstate_hwp_offline()
1017 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_pstate_hwp_offline()
1020 min_perf = HWP_LOWEST_PERF(READ_ONCE(cpu->hwp_cap_cached)); in intel_pstate_hwp_offline()
1030 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_pstate_hwp_offline()
1057 static void intel_pstate_hwp_reenable(struct cpudata *cpu) in intel_pstate_hwp_reenable() argument
1059 intel_pstate_hwp_enable(cpu); in intel_pstate_hwp_reenable()
1060 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, READ_ONCE(cpu->hwp_req_cached)); in intel_pstate_hwp_reenable()
1065 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_suspend() local
1067 pr_debug("CPU %d suspending\n", cpu->cpu); in intel_pstate_suspend()
1069 cpu->suspended = true; in intel_pstate_suspend()
1072 intel_pstate_disable_hwp_interrupt(cpu); in intel_pstate_suspend()
1079 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_resume() local
1081 pr_debug("CPU %d resuming\n", cpu->cpu); in intel_pstate_resume()
1089 if (cpu->suspended && hwp_active) { in intel_pstate_resume()
1093 intel_pstate_hwp_reenable(cpu); in intel_pstate_resume()
1098 cpu->suspended = false; in intel_pstate_resume()
1105 int cpu; in intel_pstate_update_policies() local
1107 for_each_possible_cpu(cpu) in intel_pstate_update_policies()
1108 cpufreq_update_policy(cpu); in intel_pstate_update_policies()
1119 static void intel_pstate_update_max_freq(unsigned int cpu) in intel_pstate_update_max_freq() argument
1121 struct cpufreq_policy *policy = cpufreq_cpu_acquire(cpu); in intel_pstate_update_max_freq()
1126 __intel_pstate_update_max_freq(all_cpu_data[cpu], policy); in intel_pstate_update_max_freq()
1131 static void intel_pstate_update_limits(unsigned int cpu) in intel_pstate_update_limits() argument
1143 for_each_possible_cpu(cpu) in intel_pstate_update_limits()
1144 intel_pstate_update_max_freq(cpu); in intel_pstate_update_limits()
1146 cpufreq_update_policy(cpu); in intel_pstate_update_limits()
1191 struct cpudata *cpu; in show_turbo_pct() local
1202 cpu = all_cpu_data[0]; in show_turbo_pct()
1204 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1205 no_turbo = cpu->pstate.max_pstate - cpu->pstate.min_pstate + 1; in show_turbo_pct()
1217 struct cpudata *cpu; in show_num_pstates() local
1227 cpu = all_cpu_data[0]; in show_num_pstates()
1228 total = cpu->pstate.turbo_pstate - cpu->pstate.min_pstate + 1; in show_num_pstates()
1288 struct cpudata *cpu = all_cpu_data[0]; in store_no_turbo() local
1289 int pct = cpu->pstate.max_pstate * 100 / cpu->pstate.turbo_pstate; in store_no_turbo()
1313 struct cpudata *cpu = all_cpu_data[i]; in update_qos_request() local
1327 intel_pstate_get_hwp_cap(cpu); in update_qos_request()
1336 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * perf_pct, 100); in update_qos_request()
1339 pr_warn("Failed to update freq constraint: CPU%d\n", i); in update_qos_request()
1509 * If per cpu limits are enforced there are no global limits, so in intel_pstate_sysfs_expose_params()
1575 struct cpufreq_policy *policy = cpufreq_cpu_acquire(cpudata->cpu); in intel_pstate_notify_work()
1584 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_STATUS, 0); in intel_pstate_notify_work()
1645 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x00); in intel_pstate_disable_hwp_interrupt()
1648 if (cpumask_test_and_clear_cpu(cpudata->cpu, &hwp_intr_enable_mask)) in intel_pstate_disable_hwp_interrupt()
1661 cpumask_set_cpu(cpudata->cpu, &hwp_intr_enable_mask); in intel_pstate_enable_hwp_interrupt()
1665 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x01); in intel_pstate_enable_hwp_interrupt()
1666 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_STATUS, 0); in intel_pstate_enable_hwp_interrupt()
1675 * If this CPU gen doesn't call for change in balance_perf in intel_pstate_update_epp_defaults()
1705 wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x00); in intel_pstate_hwp_enable()
1707 wrmsrl_on_cpu(cpudata->cpu, MSR_PM_ENABLE, 0x1); in intel_pstate_hwp_enable()
1811 static int core_get_min_pstate(int cpu) in core_get_min_pstate() argument
1815 rdmsrl_on_cpu(cpu, MSR_PLATFORM_INFO, &value); in core_get_min_pstate()
1819 static int core_get_max_pstate_physical(int cpu) in core_get_max_pstate_physical() argument
1823 rdmsrl_on_cpu(cpu, MSR_PLATFORM_INFO, &value); in core_get_max_pstate_physical()
1827 static int core_get_tdp_ratio(int cpu, u64 plat_info) in core_get_tdp_ratio() argument
1837 err = rdmsrl_safe_on_cpu(cpu, MSR_CONFIG_TDP_CONTROL, &tdp_ctrl); in core_get_tdp_ratio()
1843 err = rdmsrl_safe_on_cpu(cpu, tdp_msr, &tdp_ratio); in core_get_tdp_ratio()
1860 static int core_get_max_pstate(int cpu) in core_get_max_pstate() argument
1868 rdmsrl_on_cpu(cpu, MSR_PLATFORM_INFO, &plat_info); in core_get_max_pstate()
1871 tdp_ratio = core_get_tdp_ratio(cpu, plat_info); in core_get_max_pstate()
1880 err = rdmsrl_safe_on_cpu(cpu, MSR_TURBO_ACTIVATION_RATIO, &tar); in core_get_max_pstate()
1895 static int core_get_turbo_pstate(int cpu) in core_get_turbo_pstate() argument
1900 rdmsrl_on_cpu(cpu, MSR_TURBO_RATIO_LIMIT, &value); in core_get_turbo_pstate()
1901 nont = core_get_max_pstate(cpu); in core_get_turbo_pstate()
1929 static int knl_get_turbo_pstate(int cpu) in knl_get_turbo_pstate() argument
1934 rdmsrl_on_cpu(cpu, MSR_TURBO_RATIO_LIMIT, &value); in knl_get_turbo_pstate()
1935 nont = core_get_max_pstate(cpu); in knl_get_turbo_pstate()
1949 static int hybrid_get_cpu_scaling(int cpu) in hybrid_get_cpu_scaling() argument
1953 smp_call_function_single(cpu, hybrid_get_type, &cpu_type, 1); in hybrid_get_cpu_scaling()
1961 static void intel_pstate_set_pstate(struct cpudata *cpu, int pstate) in intel_pstate_set_pstate() argument
1963 trace_cpu_frequency(pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_set_pstate()
1964 cpu->pstate.current_pstate = pstate; in intel_pstate_set_pstate()
1967 * the CPU being updated, so force the register update to run on the in intel_pstate_set_pstate()
1968 * right CPU. in intel_pstate_set_pstate()
1970 wrmsrl_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL, in intel_pstate_set_pstate()
1971 pstate_funcs.get_val(cpu, pstate)); in intel_pstate_set_pstate()
1974 static void intel_pstate_set_min_pstate(struct cpudata *cpu) in intel_pstate_set_min_pstate() argument
1976 intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate); in intel_pstate_set_min_pstate()
1979 static void intel_pstate_max_within_limits(struct cpudata *cpu) in intel_pstate_max_within_limits() argument
1981 int pstate = max(cpu->pstate.min_pstate, cpu->max_perf_ratio); in intel_pstate_max_within_limits()
1984 intel_pstate_set_pstate(cpu, pstate); in intel_pstate_max_within_limits()
1987 static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) in intel_pstate_get_cpu_pstates() argument
1989 int perf_ctl_max_phys = pstate_funcs.get_max_physical(cpu->cpu); in intel_pstate_get_cpu_pstates()
1992 cpu->pstate.min_pstate = pstate_funcs.get_min(cpu->cpu); in intel_pstate_get_cpu_pstates()
1993 cpu->pstate.max_pstate_physical = perf_ctl_max_phys; in intel_pstate_get_cpu_pstates()
1994 cpu->pstate.perf_ctl_scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
1997 __intel_pstate_get_hwp_cap(cpu); in intel_pstate_get_cpu_pstates()
2000 cpu->pstate.scaling = pstate_funcs.get_cpu_scaling(cpu->cpu); in intel_pstate_get_cpu_pstates()
2001 if (cpu->pstate.scaling != perf_ctl_scaling) in intel_pstate_get_cpu_pstates()
2002 intel_pstate_hybrid_hwp_adjust(cpu); in intel_pstate_get_cpu_pstates()
2004 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2007 cpu->pstate.scaling = perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2008 cpu->pstate.max_pstate = pstate_funcs.get_max(cpu->cpu); in intel_pstate_get_cpu_pstates()
2009 cpu->pstate.turbo_pstate = pstate_funcs.get_turbo(cpu->cpu); in intel_pstate_get_cpu_pstates()
2012 if (cpu->pstate.scaling == perf_ctl_scaling) { in intel_pstate_get_cpu_pstates()
2013 cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2014 cpu->pstate.max_freq = cpu->pstate.max_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2015 cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * perf_ctl_scaling; in intel_pstate_get_cpu_pstates()
2019 cpu->aperf_mperf_shift = pstate_funcs.get_aperf_mperf_shift(); in intel_pstate_get_cpu_pstates()
2022 pstate_funcs.get_vid(cpu); in intel_pstate_get_cpu_pstates()
2024 intel_pstate_set_min_pstate(cpu); in intel_pstate_get_cpu_pstates()
2035 static inline void intel_pstate_hwp_boost_up(struct cpudata *cpu) in intel_pstate_hwp_boost_up() argument
2037 u64 hwp_req = READ_ONCE(cpu->hwp_req_cached); in intel_pstate_hwp_boost_up()
2038 u64 hwp_cap = READ_ONCE(cpu->hwp_cap_cached); in intel_pstate_hwp_boost_up()
2058 if (max_limit == min_limit || cpu->hwp_boost_min >= max_limit) in intel_pstate_hwp_boost_up()
2061 if (!cpu->hwp_boost_min) in intel_pstate_hwp_boost_up()
2062 cpu->hwp_boost_min = min_limit; in intel_pstate_hwp_boost_up()
2067 if (cpu->hwp_boost_min < boost_level1) in intel_pstate_hwp_boost_up()
2068 cpu->hwp_boost_min = boost_level1; in intel_pstate_hwp_boost_up()
2069 else if (cpu->hwp_boost_min < HWP_GUARANTEED_PERF(hwp_cap)) in intel_pstate_hwp_boost_up()
2070 cpu->hwp_boost_min = HWP_GUARANTEED_PERF(hwp_cap); in intel_pstate_hwp_boost_up()
2071 else if (cpu->hwp_boost_min == HWP_GUARANTEED_PERF(hwp_cap) && in intel_pstate_hwp_boost_up()
2073 cpu->hwp_boost_min = max_limit; in intel_pstate_hwp_boost_up()
2077 hwp_req = (hwp_req & ~GENMASK_ULL(7, 0)) | cpu->hwp_boost_min; in intel_pstate_hwp_boost_up()
2079 cpu->last_update = cpu->sample.time; in intel_pstate_hwp_boost_up()
2082 static inline void intel_pstate_hwp_boost_down(struct cpudata *cpu) in intel_pstate_hwp_boost_down() argument
2084 if (cpu->hwp_boost_min) { in intel_pstate_hwp_boost_down()
2088 expired = time_after64(cpu->sample.time, cpu->last_update + in intel_pstate_hwp_boost_down()
2091 wrmsrl(MSR_HWP_REQUEST, cpu->hwp_req_cached); in intel_pstate_hwp_boost_down()
2092 cpu->hwp_boost_min = 0; in intel_pstate_hwp_boost_down()
2095 cpu->last_update = cpu->sample.time; in intel_pstate_hwp_boost_down()
2098 static inline void intel_pstate_update_util_hwp_local(struct cpudata *cpu, in intel_pstate_update_util_hwp_local() argument
2101 cpu->sample.time = time; in intel_pstate_update_util_hwp_local()
2103 if (cpu->sched_flags & SCHED_CPUFREQ_IOWAIT) { in intel_pstate_update_util_hwp_local()
2106 cpu->sched_flags = 0; in intel_pstate_update_util_hwp_local()
2110 * some IO bound activity is scheduled on this CPU with just in intel_pstate_update_util_hwp_local()
2114 if (time_before64(time, cpu->last_io_update + 2 * TICK_NSEC)) in intel_pstate_update_util_hwp_local()
2117 cpu->last_io_update = time; in intel_pstate_update_util_hwp_local()
2120 intel_pstate_hwp_boost_up(cpu); in intel_pstate_update_util_hwp_local()
2123 intel_pstate_hwp_boost_down(cpu); in intel_pstate_update_util_hwp_local()
2130 struct cpudata *cpu = container_of(data, struct cpudata, update_util); in intel_pstate_update_util_hwp() local
2132 cpu->sched_flags |= flags; in intel_pstate_update_util_hwp()
2134 if (smp_processor_id() == cpu->cpu) in intel_pstate_update_util_hwp()
2135 intel_pstate_update_util_hwp_local(cpu, time); in intel_pstate_update_util_hwp()
2138 static inline void intel_pstate_calc_avg_perf(struct cpudata *cpu) in intel_pstate_calc_avg_perf() argument
2140 struct sample *sample = &cpu->sample; in intel_pstate_calc_avg_perf()
2145 static inline bool intel_pstate_sample(struct cpudata *cpu, u64 time) in intel_pstate_sample() argument
2155 if (cpu->prev_mperf == mperf || cpu->prev_tsc == tsc) { in intel_pstate_sample()
2161 cpu->last_sample_time = cpu->sample.time; in intel_pstate_sample()
2162 cpu->sample.time = time; in intel_pstate_sample()
2163 cpu->sample.aperf = aperf; in intel_pstate_sample()
2164 cpu->sample.mperf = mperf; in intel_pstate_sample()
2165 cpu->sample.tsc = tsc; in intel_pstate_sample()
2166 cpu->sample.aperf -= cpu->prev_aperf; in intel_pstate_sample()
2167 cpu->sample.mperf -= cpu->prev_mperf; in intel_pstate_sample()
2168 cpu->sample.tsc -= cpu->prev_tsc; in intel_pstate_sample()
2170 cpu->prev_aperf = aperf; in intel_pstate_sample()
2171 cpu->prev_mperf = mperf; in intel_pstate_sample()
2172 cpu->prev_tsc = tsc; in intel_pstate_sample()
2180 if (cpu->last_sample_time) { in intel_pstate_sample()
2181 intel_pstate_calc_avg_perf(cpu); in intel_pstate_sample()
2187 static inline int32_t get_avg_frequency(struct cpudata *cpu) in get_avg_frequency() argument
2189 return mul_ext_fp(cpu->sample.core_avg_perf, cpu_khz); in get_avg_frequency()
2192 static inline int32_t get_avg_pstate(struct cpudata *cpu) in get_avg_pstate() argument
2194 return mul_ext_fp(cpu->pstate.max_pstate_physical, in get_avg_pstate()
2195 cpu->sample.core_avg_perf); in get_avg_pstate()
2198 static inline int32_t get_target_pstate(struct cpudata *cpu) in get_target_pstate() argument
2200 struct sample *sample = &cpu->sample; in get_target_pstate()
2204 busy_frac = div_fp(sample->mperf << cpu->aperf_mperf_shift, in get_target_pstate()
2207 if (busy_frac < cpu->iowait_boost) in get_target_pstate()
2208 busy_frac = cpu->iowait_boost; in get_target_pstate()
2213 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate; in get_target_pstate()
2216 if (target < cpu->pstate.min_pstate) in get_target_pstate()
2217 target = cpu->pstate.min_pstate; in get_target_pstate()
2223 * loss related to moving the workload from one CPU to another within in get_target_pstate()
2226 avg_pstate = get_avg_pstate(cpu); in get_target_pstate()
2233 static int intel_pstate_prepare_request(struct cpudata *cpu, int pstate) in intel_pstate_prepare_request() argument
2235 int min_pstate = max(cpu->pstate.min_pstate, cpu->min_perf_ratio); in intel_pstate_prepare_request()
2236 int max_pstate = max(min_pstate, cpu->max_perf_ratio); in intel_pstate_prepare_request()
2241 static void intel_pstate_update_pstate(struct cpudata *cpu, int pstate) in intel_pstate_update_pstate() argument
2243 if (pstate == cpu->pstate.current_pstate) in intel_pstate_update_pstate()
2246 cpu->pstate.current_pstate = pstate; in intel_pstate_update_pstate()
2247 wrmsrl(MSR_IA32_PERF_CTL, pstate_funcs.get_val(cpu, pstate)); in intel_pstate_update_pstate()
2250 static void intel_pstate_adjust_pstate(struct cpudata *cpu) in intel_pstate_adjust_pstate() argument
2252 int from = cpu->pstate.current_pstate; in intel_pstate_adjust_pstate()
2258 target_pstate = get_target_pstate(cpu); in intel_pstate_adjust_pstate()
2259 target_pstate = intel_pstate_prepare_request(cpu, target_pstate); in intel_pstate_adjust_pstate()
2260 trace_cpu_frequency(target_pstate * cpu->pstate.scaling, cpu->cpu); in intel_pstate_adjust_pstate()
2261 intel_pstate_update_pstate(cpu, target_pstate); in intel_pstate_adjust_pstate()
2263 sample = &cpu->sample; in intel_pstate_adjust_pstate()
2267 cpu->pstate.current_pstate, in intel_pstate_adjust_pstate()
2271 get_avg_frequency(cpu), in intel_pstate_adjust_pstate()
2272 fp_toint(cpu->iowait_boost * 100)); in intel_pstate_adjust_pstate()
2278 struct cpudata *cpu = container_of(data, struct cpudata, update_util); in intel_pstate_update_util() local
2282 if (smp_processor_id() != cpu->cpu) in intel_pstate_update_util()
2285 delta_ns = time - cpu->last_update; in intel_pstate_update_util()
2287 /* Start over if the CPU may have been idle. */ in intel_pstate_update_util()
2289 cpu->iowait_boost = ONE_EIGHTH_FP; in intel_pstate_update_util()
2290 } else if (cpu->iowait_boost >= ONE_EIGHTH_FP) { in intel_pstate_update_util()
2291 cpu->iowait_boost <<= 1; in intel_pstate_update_util()
2292 if (cpu->iowait_boost > int_tofp(1)) in intel_pstate_update_util()
2293 cpu->iowait_boost = int_tofp(1); in intel_pstate_update_util()
2295 cpu->iowait_boost = ONE_EIGHTH_FP; in intel_pstate_update_util()
2297 } else if (cpu->iowait_boost) { in intel_pstate_update_util()
2298 /* Clear iowait_boost if the CPU may have been idle. */ in intel_pstate_update_util()
2300 cpu->iowait_boost = 0; in intel_pstate_update_util()
2302 cpu->iowait_boost >>= 1; in intel_pstate_update_util()
2304 cpu->last_update = time; in intel_pstate_update_util()
2305 delta_ns = time - cpu->sample.time; in intel_pstate_update_util()
2309 if (intel_pstate_sample(cpu, time)) in intel_pstate_update_util()
2310 intel_pstate_adjust_pstate(cpu); in intel_pstate_update_util()
2407 struct cpudata *cpu; in intel_pstate_init_cpu() local
2409 cpu = all_cpu_data[cpunum]; in intel_pstate_init_cpu()
2411 if (!cpu) { in intel_pstate_init_cpu()
2412 cpu = kzalloc(sizeof(*cpu), GFP_KERNEL); in intel_pstate_init_cpu()
2413 if (!cpu) in intel_pstate_init_cpu()
2416 WRITE_ONCE(all_cpu_data[cpunum], cpu); in intel_pstate_init_cpu()
2418 cpu->cpu = cpunum; in intel_pstate_init_cpu()
2420 cpu->epp_default = -EINVAL; in intel_pstate_init_cpu()
2425 intel_pstate_hwp_enable(cpu); in intel_pstate_init_cpu()
2434 * S3 if the CPU was offline during the whole system/resume in intel_pstate_init_cpu()
2437 intel_pstate_hwp_reenable(cpu); in intel_pstate_init_cpu()
2440 cpu->epp_powersave = -EINVAL; in intel_pstate_init_cpu()
2441 cpu->epp_policy = 0; in intel_pstate_init_cpu()
2443 intel_pstate_get_cpu_pstates(cpu); in intel_pstate_init_cpu()
2445 pr_debug("controlling: cpu %d\n", cpunum); in intel_pstate_init_cpu()
2452 struct cpudata *cpu = all_cpu_data[cpu_num]; in intel_pstate_set_update_util_hook() local
2457 if (cpu->update_util_set) in intel_pstate_set_update_util_hook()
2461 cpu->sample.time = 0; in intel_pstate_set_update_util_hook()
2462 cpufreq_add_update_util_hook(cpu_num, &cpu->update_util, in intel_pstate_set_update_util_hook()
2466 cpu->update_util_set = true; in intel_pstate_set_update_util_hook()
2469 static void intel_pstate_clear_update_util_hook(unsigned int cpu) in intel_pstate_clear_update_util_hook() argument
2471 struct cpudata *cpu_data = all_cpu_data[cpu]; in intel_pstate_clear_update_util_hook()
2476 cpufreq_remove_update_util_hook(cpu); in intel_pstate_clear_update_util_hook()
2481 static int intel_pstate_get_max_freq(struct cpudata *cpu) in intel_pstate_get_max_freq() argument
2484 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_get_max_freq()
2487 static void intel_pstate_update_perf_limits(struct cpudata *cpu, in intel_pstate_update_perf_limits() argument
2491 int perf_ctl_scaling = cpu->pstate.perf_ctl_scaling; in intel_pstate_update_perf_limits()
2507 if (hwp_active && cpu->pstate.scaling != perf_ctl_scaling) { in intel_pstate_update_perf_limits()
2508 int scaling = cpu->pstate.scaling; in intel_pstate_update_perf_limits()
2517 pr_debug("cpu:%d min_policy_perf:%d max_policy_perf:%d\n", in intel_pstate_update_perf_limits()
2518 cpu->cpu, min_policy_perf, max_policy_perf); in intel_pstate_update_perf_limits()
2522 cpu->min_perf_ratio = min_policy_perf; in intel_pstate_update_perf_limits()
2523 cpu->max_perf_ratio = max_policy_perf; in intel_pstate_update_perf_limits()
2525 int turbo_max = cpu->pstate.turbo_pstate; in intel_pstate_update_perf_limits()
2533 pr_debug("cpu:%d global_min:%d global_max:%d\n", cpu->cpu, in intel_pstate_update_perf_limits()
2536 cpu->min_perf_ratio = max(min_policy_perf, global_min); in intel_pstate_update_perf_limits()
2537 cpu->min_perf_ratio = min(cpu->min_perf_ratio, max_policy_perf); in intel_pstate_update_perf_limits()
2538 cpu->max_perf_ratio = min(max_policy_perf, global_max); in intel_pstate_update_perf_limits()
2539 cpu->max_perf_ratio = max(min_policy_perf, cpu->max_perf_ratio); in intel_pstate_update_perf_limits()
2542 cpu->min_perf_ratio = min(cpu->min_perf_ratio, in intel_pstate_update_perf_limits()
2543 cpu->max_perf_ratio); in intel_pstate_update_perf_limits()
2546 pr_debug("cpu:%d max_perf_ratio:%d min_perf_ratio:%d\n", cpu->cpu, in intel_pstate_update_perf_limits()
2547 cpu->max_perf_ratio, in intel_pstate_update_perf_limits()
2548 cpu->min_perf_ratio); in intel_pstate_update_perf_limits()
2553 struct cpudata *cpu; in intel_pstate_set_policy() local
2561 cpu = all_cpu_data[policy->cpu]; in intel_pstate_set_policy()
2562 cpu->policy = policy->policy; in intel_pstate_set_policy()
2566 intel_pstate_update_perf_limits(cpu, policy->min, policy->max); in intel_pstate_set_policy()
2568 if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) { in intel_pstate_set_policy()
2573 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2574 intel_pstate_max_within_limits(cpu); in intel_pstate_set_policy()
2576 intel_pstate_set_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2586 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_set_policy()
2587 intel_pstate_hwp_set(policy->cpu); in intel_pstate_set_policy()
2595 static void intel_pstate_adjust_policy_max(struct cpudata *cpu, in intel_pstate_adjust_policy_max() argument
2599 cpu->pstate.max_pstate_physical > cpu->pstate.max_pstate && in intel_pstate_adjust_policy_max()
2601 policy->max > cpu->pstate.max_freq) { in intel_pstate_adjust_policy_max()
2607 static void intel_pstate_verify_cpu_policy(struct cpudata *cpu, in intel_pstate_verify_cpu_policy() argument
2614 intel_pstate_get_hwp_cap(cpu); in intel_pstate_verify_cpu_policy()
2616 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in intel_pstate_verify_cpu_policy()
2618 max_freq = intel_pstate_get_max_freq(cpu); in intel_pstate_verify_cpu_policy()
2622 intel_pstate_adjust_policy_max(cpu, policy); in intel_pstate_verify_cpu_policy()
2627 intel_pstate_verify_cpu_policy(all_cpu_data[policy->cpu], policy); in intel_pstate_verify_policy()
2634 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_cpu_offline() local
2636 pr_debug("CPU %d going offline\n", cpu->cpu); in intel_cpufreq_cpu_offline()
2638 if (cpu->suspended) in intel_cpufreq_cpu_offline()
2642 * If the CPU is an SMT thread and it goes offline with the performance in intel_cpufreq_cpu_offline()
2645 * performance on CPU offline to prevent that from happening. in intel_cpufreq_cpu_offline()
2648 intel_pstate_hwp_offline(cpu); in intel_cpufreq_cpu_offline()
2650 intel_pstate_set_min_pstate(cpu); in intel_cpufreq_cpu_offline()
2659 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_cpu_online() local
2661 pr_debug("CPU %d going online\n", cpu->cpu); in intel_pstate_cpu_online()
2670 intel_pstate_hwp_reenable(cpu); in intel_pstate_cpu_online()
2671 cpu->suspended = false; in intel_pstate_cpu_online()
2679 intel_pstate_clear_update_util_hook(policy->cpu); in intel_pstate_cpu_offline()
2686 pr_debug("CPU %d exiting\n", policy->cpu); in intel_pstate_cpu_exit()
2695 struct cpudata *cpu; in __intel_pstate_cpu_init() local
2698 rc = intel_pstate_init_cpu(policy->cpu); in __intel_pstate_cpu_init()
2702 cpu = all_cpu_data[policy->cpu]; in __intel_pstate_cpu_init()
2704 cpu->max_perf_ratio = 0xFF; in __intel_pstate_cpu_init()
2705 cpu->min_perf_ratio = 0; in __intel_pstate_cpu_init()
2708 policy->cpuinfo.min_freq = cpu->pstate.min_freq; in __intel_pstate_cpu_init()
2712 cpu->pstate.max_freq : cpu->pstate.turbo_freq; in __intel_pstate_cpu_init()
2738 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_pstate_cpu_init() local
2740 cpu->epp_cached = intel_pstate_get_epp(cpu, 0); in intel_pstate_cpu_init()
2762 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_verify_policy() local
2764 intel_pstate_verify_cpu_policy(cpu, policy); in intel_cpufreq_verify_policy()
2765 intel_pstate_update_perf_limits(cpu, policy->min, policy->max); in intel_cpufreq_verify_policy()
2786 static void intel_cpufreq_trace(struct cpudata *cpu, unsigned int trace_type, int old_pstate) in intel_cpufreq_trace() argument
2793 if (!intel_pstate_sample(cpu, ktime_get())) in intel_cpufreq_trace()
2796 sample = &cpu->sample; in intel_cpufreq_trace()
2800 cpu->pstate.current_pstate, in intel_cpufreq_trace()
2804 get_avg_frequency(cpu), in intel_cpufreq_trace()
2805 fp_toint(cpu->iowait_boost * 100)); in intel_cpufreq_trace()
2808 static void intel_cpufreq_hwp_update(struct cpudata *cpu, u32 min, u32 max, in intel_cpufreq_hwp_update() argument
2811 u64 prev = READ_ONCE(cpu->hwp_req_cached), value = prev; in intel_cpufreq_hwp_update()
2825 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_cpufreq_hwp_update()
2829 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_cpufreq_hwp_update()
2832 static void intel_cpufreq_perf_ctl_update(struct cpudata *cpu, in intel_cpufreq_perf_ctl_update() argument
2837 pstate_funcs.get_val(cpu, target_pstate)); in intel_cpufreq_perf_ctl_update()
2839 wrmsrl_on_cpu(cpu->cpu, MSR_IA32_PERF_CTL, in intel_cpufreq_perf_ctl_update()
2840 pstate_funcs.get_val(cpu, target_pstate)); in intel_cpufreq_perf_ctl_update()
2846 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_update_pstate() local
2847 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_update_pstate()
2849 target_pstate = intel_pstate_prepare_request(cpu, target_pstate); in intel_cpufreq_update_pstate()
2852 target_pstate : cpu->max_perf_ratio; in intel_cpufreq_update_pstate()
2854 intel_cpufreq_hwp_update(cpu, target_pstate, max_pstate, 0, in intel_cpufreq_update_pstate()
2857 intel_cpufreq_perf_ctl_update(cpu, target_pstate, fast_switch); in intel_cpufreq_update_pstate()
2860 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_update_pstate()
2862 intel_cpufreq_trace(cpu, fast_switch ? INTEL_PSTATE_TRACE_FAST_SWITCH : in intel_cpufreq_update_pstate()
2872 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_target() local
2885 target_pstate = DIV_ROUND_UP(freqs.new, cpu->pstate.scaling); in intel_cpufreq_target()
2888 target_pstate = freqs.new / cpu->pstate.scaling; in intel_cpufreq_target()
2891 target_pstate = DIV_ROUND_CLOSEST(freqs.new, cpu->pstate.scaling); in intel_cpufreq_target()
2897 freqs.new = target_pstate * cpu->pstate.scaling; in intel_cpufreq_target()
2907 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_fast_switch() local
2912 target_pstate = DIV_ROUND_UP(target_freq, cpu->pstate.scaling); in intel_cpufreq_fast_switch()
2916 return target_pstate * cpu->pstate.scaling; in intel_cpufreq_fast_switch()
2924 struct cpudata *cpu = all_cpu_data[cpunum]; in intel_cpufreq_adjust_perf() local
2925 u64 hwp_cap = READ_ONCE(cpu->hwp_cap_cached); in intel_cpufreq_adjust_perf()
2926 int old_pstate = cpu->pstate.current_pstate; in intel_cpufreq_adjust_perf()
2943 if (min_pstate < cpu->pstate.min_pstate) in intel_cpufreq_adjust_perf()
2944 min_pstate = cpu->pstate.min_pstate; in intel_cpufreq_adjust_perf()
2946 if (min_pstate < cpu->min_perf_ratio) in intel_cpufreq_adjust_perf()
2947 min_pstate = cpu->min_perf_ratio; in intel_cpufreq_adjust_perf()
2949 max_pstate = min(cap_pstate, cpu->max_perf_ratio); in intel_cpufreq_adjust_perf()
2955 intel_cpufreq_hwp_update(cpu, min_pstate, max_pstate, target_pstate, true); in intel_cpufreq_adjust_perf()
2957 cpu->pstate.current_pstate = target_pstate; in intel_cpufreq_adjust_perf()
2958 intel_cpufreq_trace(cpu, INTEL_PSTATE_TRACE_FAST_SWITCH, old_pstate); in intel_cpufreq_adjust_perf()
2964 struct cpudata *cpu; in intel_cpufreq_cpu_init() local
2968 dev = get_cpu_device(policy->cpu); in intel_cpufreq_cpu_init()
2986 cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_cpu_init()
2993 intel_pstate_get_hwp_cap(cpu); in intel_cpufreq_cpu_init()
2995 rdmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, &value); in intel_cpufreq_cpu_init()
2996 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_cpufreq_cpu_init()
2998 cpu->epp_cached = intel_pstate_get_epp(cpu, value); in intel_cpufreq_cpu_init()
3003 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.min_perf_pct, 100); in intel_cpufreq_cpu_init()
3012 freq = DIV_ROUND_UP(cpu->pstate.turbo_freq * global.max_perf_pct, 100); in intel_cpufreq_cpu_init()
3053 struct cpudata *cpu = all_cpu_data[policy->cpu]; in intel_cpufreq_suspend() local
3054 u64 value = READ_ONCE(cpu->hwp_req_cached); in intel_cpufreq_suspend()
3062 wrmsrl_on_cpu(cpu->cpu, MSR_HWP_REQUEST, value); in intel_cpufreq_suspend()
3063 WRITE_ONCE(cpu->hwp_req_cached, value); in intel_cpufreq_suspend()
3088 unsigned int cpu; in intel_pstate_driver_cleanup() local
3091 for_each_online_cpu(cpu) { in intel_pstate_driver_cleanup()
3092 if (all_cpu_data[cpu]) { in intel_pstate_driver_cleanup()
3094 intel_pstate_clear_update_util_hook(cpu); in intel_pstate_driver_cleanup()
3097 kfree(all_cpu_data[cpu]); in intel_pstate_driver_cleanup()
3098 WRITE_ONCE(all_cpu_data[cpu], NULL); in intel_pstate_driver_cleanup()
3425 pr_info("CPU model not supported\n"); in intel_pstate_init()