cpufreq: loongson3-acpi: Initialize scaling_cur_freq correctly

The policy->cur was not being initialized properly during CPU
initialization, leading to it always reporting 0. This commit addresses
this issue by setting the initial frequency to the normal maximum
frequency.

This ensures that the current frequency reflects the actual CPU
operating frequency.

Fixes: 31a15a203ba9 ("cpufreq: loongson3-acpi: Initialize scaling_cur_freq correctly")
Signed-off-by: Ming Wang <wangming01@loongson.cn>
This commit is contained in:
Ming Wang 2024-10-31 17:44:39 +08:00
parent 45dbbcbd4b
commit 29e640a558
1 changed files with 2 additions and 0 deletions

View File

@ -1257,6 +1257,8 @@ static int loongson3_cpufreq_cpu_init(struct cpufreq_policy *policy)
if (has_boost_freq() && boost_supported())
loongson3_cpufreq_attr[1] = &cpufreq_freq_attr_scaling_boost_freqs;
policy->cur = core->normal_max_freq * 1000;
pr_info("CPU%u - ACPI performance management activated.\n", cpu);
for (i = 0; i < perf->state_count; i++)
pr_debug(" %cP%d: %d MHz, %d mW, %d uS %d level\n",