···675675}676676#endif677677678678+static void acpi_cpufreq_resolve_max_freq(struct cpufreq_policy *policy,679679+ unsigned int pss_max_freq)680680+{681681+#ifdef CONFIG_ACPI_CPPC_LIB682682+ u64 max_speed = cppc_get_dmi_max_khz();683683+ /*684684+ * Use DMI "Max Speed" if it looks plausible: must be685685+ * above _PSS P0 frequency and within 2x of it.686686+ */687687+ if (max_speed > pss_max_freq && max_speed < pss_max_freq * 2) {688688+ policy->cpuinfo.max_freq = max_speed;689689+ return;690690+ }691691+#endif692692+ /*693693+ * If the maximum "boost" frequency is unknown, ask the arch694694+ * scale-invariance code to use the "nominal" performance for695695+ * CPU utilization scaling so as to prevent the schedutil696696+ * governor from selecting inadequate CPU frequencies.697697+ */698698+ arch_set_max_freq_ratio(true);699699+}700700+678701static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)679702{680703 struct cpufreq_frequency_table *freq_table;···872849873850 policy->cpuinfo.max_freq = freq * max_boost_ratio >> SCHED_CAPACITY_SHIFT;874851 } else {875875- /*876876- * If the maximum "boost" frequency is unknown, ask the arch877877- * scale-invariance code to use the "nominal" performance for878878- * CPU utilization scaling so as to prevent the schedutil879879- * governor from selecting inadequate CPU frequencies.880880- */881881- arch_set_max_freq_ratio(true);852852+ acpi_cpufreq_resolve_max_freq(policy, freq_table[0].frequency);882853 }883854884855 policy->freq_table = freq_table;
+2-2
drivers/cpufreq/cpufreq.c
···23642364 target_freq = __resolve_freq(policy, target_freq, policy->min,23652365 policy->max, relation);2366236623672367- pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",23682368- policy->cpu, target_freq, relation, old_target_freq);23672367+ pr_debug("CPU %u: cur %u kHz -> target %u kHz (req %u kHz, rel %u)\n",23682368+ policy->cpu, policy->cur, target_freq, old_target_freq, relation);2369236923702370 /*23712371 * This might look like a redundant call as we are checking it again