public inbox for cpufreq@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] acpi-cpufreq: set current frequency based on target P-State
@ 2013-05-31 19:45 Ross Lagerwall
  2013-05-31 21:33 ` Len Brown
  2013-06-01  9:48 ` Viresh Kumar
  0 siblings, 2 replies; 4+ messages in thread
From: Ross Lagerwall @ 2013-05-31 19:45 UTC (permalink / raw)
  To: cpufreq; +Cc: Andre Przywara, Matthew Garrett, Ross Lagerwall

4b31e774 fixed bug #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.  5a1c0228 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 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 <rosslagerwall@gmail.com>
---
 drivers/cpufreq/acpi-cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 11b8b4b..edc089e 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -347,11 +347,11 @@ static u32 get_cur_val(const struct cpumask *mask)
 	switch (per_cpu(acfreq_data, cpumask_first(mask))->cpu_feature) {
 	case SYSTEM_INTEL_MSR_CAPABLE:
 		cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
-		cmd.addr.msr.reg = MSR_IA32_PERF_STATUS;
+		cmd.addr.msr.reg = MSR_IA32_PERF_CTL;
 		break;
 	case SYSTEM_AMD_MSR_CAPABLE:
 		cmd.type = SYSTEM_AMD_MSR_CAPABLE;
-		cmd.addr.msr.reg = MSR_AMD_PERF_STATUS;
+		cmd.addr.msr.reg = MSR_AMD_PERF_CTL;
 		break;
 	case SYSTEM_IO_CAPABLE:
 		cmd.type = SYSTEM_IO_CAPABLE;
-- 
1.8.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* Re: [stable request <=3.5] acpi-cpufreq: set current frequency based on target P-State
@ 2013-12-20  8:19 Ross Lagerwall
  2014-03-25 22:04 ` [stable request <=3.7] " Vinson Lee
  0 siblings, 1 reply; 4+ messages in thread
From: Ross Lagerwall @ 2013-12-20  8:19 UTC (permalink / raw)
  To: Vinson Lee
  Cc: stable, Rafael J. Wysocki, Viresh Kumar, cpufreq, linux-pm,
	Shatil Rafitullah, Len Brown, Rafael J. Wysocki

On Thu, Dec 19, 2013 at 06:14:12PM -0800, Vinson Lee wrote:
> Hi.
> 
> Is commit 8673b83bf2f013379453b4779047bf3c6ae387e4 "acpi-cpufreq: set
> current frequency based on target P-State" applicable to kernels
> before 3.8?
> 
> We found that this patch allows the kernel to control P-states on
> 3.4.74 on some platforms. However, other platforms were able to change
> P-states even without this patch.
> 

Well, it fixes a regression introduced in 3.8 which affected setting
turbo frequencies (I'm not sure if the 3.8 patch was backported).
However, there may be other situations where the target frequency is
different from the reported frequency which 8673b83bf2f0 could well fix.

Cheers
-- 
Ross Lagerwall

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-25 22:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-31 19:45 [PATCH] acpi-cpufreq: set current frequency based on target P-State Ross Lagerwall
2013-05-31 21:33 ` Len Brown
2013-06-01  9:48 ` Viresh Kumar
  -- strict thread matches above, loose matches on Subject: below --
2013-12-20  8:19 [stable request <=3.5] " Ross Lagerwall
2014-03-25 22:04 ` [stable request <=3.7] " Vinson Lee
2014-03-25 22:04   ` [PATCH] " Vinson Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox