Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge back earlier cpufreq material for v6.2.

+14 -43
+6 -36
drivers/cpufreq/acpi-cpufreq.c
··· 19 19 #include <linux/compiler.h> 20 20 #include <linux/dmi.h> 21 21 #include <linux/slab.h> 22 + #include <linux/string_helpers.h> 22 23 23 24 #include <linux/acpi.h> 24 25 #include <linux/io.h> ··· 136 135 { 137 136 on_each_cpu_mask(policy->cpus, boost_set_msr_each, 138 137 (void *)(long)val, 1); 139 - pr_debug("CPU %*pbl: Core Boosting %sabled.\n", 140 - cpumask_pr_args(policy->cpus), val ? "en" : "dis"); 138 + pr_debug("CPU %*pbl: Core Boosting %s.\n", 139 + cpumask_pr_args(policy->cpus), str_enabled_disabled(val)); 141 140 142 141 return 0; 143 142 } ··· 536 535 free_percpu(acpi_perf_data); 537 536 } 538 537 539 - static int cpufreq_boost_online(unsigned int cpu) 540 - { 541 - /* 542 - * On the CPU_UP path we simply keep the boost-disable flag 543 - * in sync with the current global state. 544 - */ 545 - return boost_set_msr(acpi_cpufreq_driver.boost_enabled); 546 - } 547 - 548 538 static int cpufreq_boost_down_prep(unsigned int cpu) 549 539 { 550 540 /* ··· 889 897 if (perf->states[0].core_frequency * 1000 != freq_table[0].frequency) 890 898 pr_warn(FW_WARN "P-state 0 is not max freq\n"); 891 899 900 + set_boost(policy, acpi_cpufreq_driver.boost_enabled); 901 + 892 902 return result; 893 903 894 904 err_unreg: ··· 910 916 911 917 pr_debug("%s\n", __func__); 912 918 919 + cpufreq_boost_down_prep(policy->cpu); 913 920 policy->fast_switch_possible = false; 914 921 policy->driver_data = NULL; 915 922 acpi_processor_unregister_performance(data->acpi_perf_cpu); ··· 953 958 .attr = acpi_cpufreq_attr, 954 959 }; 955 960 956 - static enum cpuhp_state acpi_cpufreq_online; 957 - 958 961 static void __init acpi_cpufreq_boost_init(void) 959 962 { 960 - int ret; 961 - 962 963 if (!(boot_cpu_has(X86_FEATURE_CPB) || boot_cpu_has(X86_FEATURE_IDA))) { 963 964 pr_debug("Boost capabilities not present in the processor\n"); 964 965 return; ··· 962 971 963 972 acpi_cpufreq_driver.set_boost = set_boost; 964 973 acpi_cpufreq_driver.boost_enabled = boost_state(0); 965 - 966 - /* 967 - * This calls the online callback on all online cpu and forces all 968 - * MSRs to the same value. 969 - */ 970 - ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "cpufreq/acpi:online", 971 - cpufreq_boost_online, cpufreq_boost_down_prep); 972 - if (ret < 0) { 973 - pr_err("acpi_cpufreq: failed to register hotplug callbacks\n"); 974 - return; 975 - } 976 - acpi_cpufreq_online = ret; 977 - } 978 - 979 - static void acpi_cpufreq_boost_exit(void) 980 - { 981 - if (acpi_cpufreq_online > 0) 982 - cpuhp_remove_state_nocalls(acpi_cpufreq_online); 983 974 } 984 975 985 976 static int __init acpi_cpufreq_init(void) ··· 1005 1032 ret = cpufreq_register_driver(&acpi_cpufreq_driver); 1006 1033 if (ret) { 1007 1034 free_acpi_perf_data(); 1008 - acpi_cpufreq_boost_exit(); 1009 1035 } 1010 1036 return ret; 1011 1037 } ··· 1012 1040 static void __exit acpi_cpufreq_exit(void) 1013 1041 { 1014 1042 pr_debug("%s\n", __func__); 1015 - 1016 - acpi_cpufreq_boost_exit(); 1017 1043 1018 1044 cpufreq_unregister_driver(&acpi_cpufreq_driver); 1019 1045
+5 -4
drivers/cpufreq/intel_pstate.c
··· 298 298 static int hwp_mode_bdw __read_mostly; 299 299 static bool per_cpu_limits __read_mostly; 300 300 static bool hwp_boost __read_mostly; 301 + static bool hwp_forced __read_mostly; 301 302 302 303 static struct cpufreq_driver *intel_pstate_driver __read_mostly; 303 304 ··· 1680 1679 return; 1681 1680 1682 1681 /* 1683 - * If powerup EPP is something other than chipset default 0x80 and 1684 - * - is more performance oriented than 0x80 (default balance_perf EPP) 1682 + * If the EPP is set by firmware, which means that firmware enabled HWP 1683 + * - Is equal or less than 0x80 (default balance_perf EPP) 1685 1684 * - But less performance oriented than performance EPP 1686 1685 * then use this as new balance_perf EPP. 1687 1686 */ 1688 - if (cpudata->epp_default < HWP_EPP_BALANCE_PERFORMANCE && 1687 + if (hwp_forced && cpudata->epp_default <= HWP_EPP_BALANCE_PERFORMANCE && 1689 1688 cpudata->epp_default > HWP_EPP_PERFORMANCE) { 1690 1689 epp_values[EPP_INDEX_BALANCE_PERFORMANCE] = cpudata->epp_default; 1691 1690 return; ··· 3385 3384 3386 3385 id = x86_match_cpu(hwp_support_ids); 3387 3386 if (id) { 3388 - bool hwp_forced = intel_pstate_hwp_is_enabled(); 3387 + hwp_forced = intel_pstate_hwp_is_enabled(); 3389 3388 3390 3389 if (hwp_forced) 3391 3390 pr_info("HWP enabled by BIOS\n");
+2 -2
drivers/cpufreq/longhaul.c
··· 407 407 { 408 408 int speed = cpu_khz / 1000; 409 409 int i; 410 - int speeds[] = { 666, 1000, 1333, 2000 }; 410 + static const int speeds[] = { 666, 1000, 1333, 2000 }; 411 411 int f_max, f_min; 412 412 413 - for (i = 0; i < 4; i++) { 413 + for (i = 0; i < ARRAY_SIZE(speeds); i++) { 414 414 f_max = ((speeds[i] * mult) + 50) / 100; 415 415 f_max += (ROUNDING / 2); 416 416 f_min = f_max - ROUNDING;
+1 -1
drivers/cpufreq/spear-cpufreq.c
··· 39 39 * In SPEAr1340, cpu clk's parent sys clk can take input from 40 40 * following sources 41 41 */ 42 - const char *sys_clk_src[] = { 42 + static const char * const sys_clk_src[] = { 43 43 "sys_syn_clk", 44 44 "pll1_clk", 45 45 "pll2_clk",