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

Configure Feed

Select the types of activity you want to include in your feed.

cpufreq: Don't skip cpufreq_frequency_table_cpuinfo()

The commit 6db0f533d320 ("cpufreq: preserve freq_table_sorted
across suspend/hibernate") unintentionally made a change where
cpufreq_frequency_table_cpuinfo() isn't getting called anymore
for old policies getting re-initialized.

This leads to potentially invalid values of policy->max and
policy->cpuinfo_max_freq.

Fix the issue by reverting the original commit and adding the condition
for just the sorting function.

Fixes: 6db0f533d320 ("cpufreq: preserve freq_table_sorted across suspend/hibernate")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 6.19+ <stable@vger.kernel.org> # 6.19+
Link: https://patch.msgid.link/65ba5c45749267c82e8a87af3dc788b37a0b3f48.1773998611.git.viresh.kumar@linaro.org
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Viresh Kumar and committed by
Rafael J. Wysocki
8f13c0c6 c3692998

+7 -6
+3 -6
drivers/cpufreq/cpufreq.c
··· 1427 1427 * If there is a problem with its frequency table, take it 1428 1428 * offline and drop it. 1429 1429 */ 1430 - if (policy->freq_table_sorted != CPUFREQ_TABLE_SORTED_ASCENDING && 1431 - policy->freq_table_sorted != CPUFREQ_TABLE_SORTED_DESCENDING) { 1432 - ret = cpufreq_table_validate_and_sort(policy); 1433 - if (ret) 1434 - goto out_offline_policy; 1435 - } 1430 + ret = cpufreq_table_validate_and_sort(policy); 1431 + if (ret) 1432 + goto out_offline_policy; 1436 1433 1437 1434 /* related_cpus should at least include policy->cpus. */ 1438 1435 cpumask_copy(policy->related_cpus, policy->cpus);
+4
drivers/cpufreq/freq_table.c
··· 360 360 if (policy_has_boost_freq(policy)) 361 361 policy->boost_supported = true; 362 362 363 + if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING || 364 + policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_DESCENDING) 365 + return 0; 366 + 363 367 return set_freq_table_sorted(policy); 364 368 } 365 369