Skip to content

Commit 8673b83

Browse files
rosslagerwallrafaeljw
authored andcommitted
acpi-cpufreq: set current frequency based on target P-State
Commit 4b31e77 (Always set P-state on initialization) fixed bug raspberrypi#4634 and caused the driver to always set the target P-State at least once since the initial P-State may not be the desired one. Commit 5a1c022 (cpufreq: Avoid calling cpufreq driver's target() routine if target_freq == policy->cur) caused a regression in this behavior. This fixes the regression by setting policy->cur based on the CPU's target frequency rather than the CPU's current reported frequency (which may be different). This means that the P-State will be set initially if the CPU's target frequency is different from the governor's target frequency. This fixes an issue where setting the default governor to performance wouldn't correctly enable turbo mode on all cores. Signed-off-by: Ross Lagerwall <[email protected]> Reviewed-by: Len Brown <[email protected]> Acked-by: Viresh Kumar <[email protected]> Cc: 3.8+ <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent d683b96 commit 8673b83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/cpufreq/acpi-cpufreq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,11 @@ static u32 get_cur_val(const struct cpumask *mask)
347347
switch (per_cpu(acfreq_data, cpumask_first(mask))->cpu_feature) {
348348
case SYSTEM_INTEL_MSR_CAPABLE:
349349
cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
350-
cmd.addr.msr.reg = MSR_IA32_PERF_STATUS;
350+
cmd.addr.msr.reg = MSR_IA32_PERF_CTL;
351351
break;
352352
case SYSTEM_AMD_MSR_CAPABLE:
353353
cmd.type = SYSTEM_AMD_MSR_CAPABLE;
354-
cmd.addr.msr.reg = MSR_AMD_PERF_STATUS;
354+
cmd.addr.msr.reg = MSR_AMD_PERF_CTL;
355355
break;
356356
case SYSTEM_IO_CAPABLE:
357357
cmd.type = SYSTEM_IO_CAPABLE;

0 commit comments

Comments
 (0)