···1919#include <linux/compiler.h>2020#include <linux/dmi.h>2121#include <linux/slab.h>2222+#include <linux/string_helpers.h>22232324#include <linux/acpi.h>2425#include <linux/io.h>···136135{137136 on_each_cpu_mask(policy->cpus, boost_set_msr_each,138137 (void *)(long)val, 1);139139- pr_debug("CPU %*pbl: Core Boosting %sabled.\n",140140- cpumask_pr_args(policy->cpus), val ? "en" : "dis");138138+ pr_debug("CPU %*pbl: Core Boosting %s.\n",139139+ cpumask_pr_args(policy->cpus), str_enabled_disabled(val));141140142141 return 0;143142}···536535 free_percpu(acpi_perf_data);537536}538537539539-static int cpufreq_boost_online(unsigned int cpu)540540-{541541- /*542542- * On the CPU_UP path we simply keep the boost-disable flag543543- * in sync with the current global state.544544- */545545- return boost_set_msr(acpi_cpufreq_driver.boost_enabled);546546-}547547-548538static int cpufreq_boost_down_prep(unsigned int cpu)549539{550540 /*···889897 if (perf->states[0].core_frequency * 1000 != freq_table[0].frequency)890898 pr_warn(FW_WARN "P-state 0 is not max freq\n");891899900900+ set_boost(policy, acpi_cpufreq_driver.boost_enabled);901901+892902 return result;893903894904err_unreg:···910916911917 pr_debug("%s\n", __func__);912918919919+ cpufreq_boost_down_prep(policy->cpu);913920 policy->fast_switch_possible = false;914921 policy->driver_data = NULL;915922 acpi_processor_unregister_performance(data->acpi_perf_cpu);···953958 .attr = acpi_cpufreq_attr,954959};955960956956-static enum cpuhp_state acpi_cpufreq_online;957957-958961static void __init acpi_cpufreq_boost_init(void)959962{960960- int ret;961961-962963 if (!(boot_cpu_has(X86_FEATURE_CPB) || boot_cpu_has(X86_FEATURE_IDA))) {963964 pr_debug("Boost capabilities not present in the processor\n");964965 return;···962971963972 acpi_cpufreq_driver.set_boost = set_boost;964973 acpi_cpufreq_driver.boost_enabled = boost_state(0);965965-966966- /*967967- * This calls the online callback on all online cpu and forces all968968- * MSRs to the same value.969969- */970970- ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "cpufreq/acpi:online",971971- cpufreq_boost_online, cpufreq_boost_down_prep);972972- if (ret < 0) {973973- pr_err("acpi_cpufreq: failed to register hotplug callbacks\n");974974- return;975975- }976976- acpi_cpufreq_online = ret;977977-}978978-979979-static void acpi_cpufreq_boost_exit(void)980980-{981981- if (acpi_cpufreq_online > 0)982982- cpuhp_remove_state_nocalls(acpi_cpufreq_online);983974}984975985976static int __init acpi_cpufreq_init(void)···10051032 ret = cpufreq_register_driver(&acpi_cpufreq_driver);10061033 if (ret) {10071034 free_acpi_perf_data();10081008- acpi_cpufreq_boost_exit();10091035 }10101036 return ret;10111037}···10121040static void __exit acpi_cpufreq_exit(void)10131041{10141042 pr_debug("%s\n", __func__);10151015-10161016- acpi_cpufreq_boost_exit();1017104310181044 cpufreq_unregister_driver(&acpi_cpufreq_driver);10191045
+5-4
drivers/cpufreq/intel_pstate.c
···298298static int hwp_mode_bdw __read_mostly;299299static bool per_cpu_limits __read_mostly;300300static bool hwp_boost __read_mostly;301301+static bool hwp_forced __read_mostly;301302302303static struct cpufreq_driver *intel_pstate_driver __read_mostly;303304···16801679 return;1681168016821681 /*16831683- * If powerup EPP is something other than chipset default 0x80 and16841684- * - is more performance oriented than 0x80 (default balance_perf EPP)16821682+ * If the EPP is set by firmware, which means that firmware enabled HWP16831683+ * - Is equal or less than 0x80 (default balance_perf EPP)16851684 * - But less performance oriented than performance EPP16861685 * then use this as new balance_perf EPP.16871686 */16881688- if (cpudata->epp_default < HWP_EPP_BALANCE_PERFORMANCE &&16871687+ if (hwp_forced && cpudata->epp_default <= HWP_EPP_BALANCE_PERFORMANCE &&16891688 cpudata->epp_default > HWP_EPP_PERFORMANCE) {16901689 epp_values[EPP_INDEX_BALANCE_PERFORMANCE] = cpudata->epp_default;16911690 return;···3385338433863385 id = x86_match_cpu(hwp_support_ids);33873386 if (id) {33883388- bool hwp_forced = intel_pstate_hwp_is_enabled();33873387+ hwp_forced = intel_pstate_hwp_is_enabled();3389338833903389 if (hwp_forced)33913390 pr_info("HWP enabled by BIOS\n");
+2-2
drivers/cpufreq/longhaul.c
···407407{408408 int speed = cpu_khz / 1000;409409 int i;410410- int speeds[] = { 666, 1000, 1333, 2000 };410410+ static const int speeds[] = { 666, 1000, 1333, 2000 };411411 int f_max, f_min;412412413413- for (i = 0; i < 4; i++) {413413+ for (i = 0; i < ARRAY_SIZE(speeds); i++) {414414 f_max = ((speeds[i] * mult) + 50) / 100;415415 f_max += (ROUNDING / 2);416416 f_min = f_max - ROUNDING;
+1-1
drivers/cpufreq/spear-cpufreq.c
···3939 * In SPEAr1340, cpu clk's parent sys clk can take input from4040 * following sources4141 */4242- const char *sys_clk_src[] = {4242+ static const char * const sys_clk_src[] = {4343 "sys_syn_clk",4444 "pll1_clk",4545 "pll2_clk",