linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [stable request <=3.5] acpi-cpufreq: set current frequency based on target P-State
@ 2013-12-20  2:14 Vinson Lee
  2013-12-20  8:19 ` Ross Lagerwall
  0 siblings, 1 reply; 9+ messages in thread
From: Vinson Lee @ 2013-12-20  2:14 UTC (permalink / raw)
  To: stable
  Cc: Rafael J. Wysocki, Viresh Kumar, cpufreq, linux-pm,
	Shatil Rafitullah, Len Brown, Ross Lagerwall, Rafael J. Wysocki

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.

Cheers,
Vinson

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

* Re: [stable request <=3.5] acpi-cpufreq: set current frequency based on target P-State
  2013-12-20  2:14 [stable request <=3.5] acpi-cpufreq: set current frequency based on target P-State Vinson Lee
@ 2013-12-20  8:19 ` Ross Lagerwall
  2014-03-25 22:04   ` [stable request <=3.7] " Vinson Lee
  0 siblings, 1 reply; 9+ 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] 9+ messages in thread

* [stable request <=3.7] acpi-cpufreq: set current frequency based on target P-State
  2013-12-20  8:19 ` Ross Lagerwall
@ 2014-03-25 22:04   ` Vinson Lee
  2014-03-25 22:04     ` [PATCH] " Vinson Lee
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Vinson Lee @ 2014-03-25 22:04 UTC (permalink / raw)
  To: stable
  Cc: Rafael J. Wysocki, Viresh Kumar, cpufreq, linux-pm, Len Brown,
	Ross Lagerwall, Rafael J. Wysocki, Vinson Lee

Hi.

Please backport upstream commit 8673b83bf2f013379453b4779047bf3c6ae387e4 
"acpi-cpufreq: set current frequency based on target P-State" to stable 
kernels 3.7 and earlier. This patch enables the kernel to control 
P-states on several platforms. Without this patch, the kernel was unable 
to control P-states on the same platforms.

The upstream patch cleanly applies to 3.7.

A backported patch is needed with the removal of SYSTEM_AMD_MSR_CAPABLE 
for kernels 3.6 and earlier.

Cheers,
Vinson


Ross Lagerwall (1):
  acpi-cpufreq: set current frequency based on target P-State

 drivers/cpufreq/acpi-cpufreq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

-- 
1.8.3.2

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

* [PATCH] acpi-cpufreq: set current frequency based on target P-State
  2014-03-25 22:04   ` [stable request <=3.7] " Vinson Lee
@ 2014-03-25 22:04     ` Vinson Lee
  2014-03-25 22:18     ` [stable request <=3.7] " rosslagerwall
  2014-03-31  8:50     ` Luís Henriques
  2 siblings, 0 replies; 9+ messages in thread
From: Vinson Lee @ 2014-03-25 22:04 UTC (permalink / raw)
  To: stable
  Cc: Rafael J. Wysocki, Viresh Kumar, cpufreq, linux-pm, Len Brown,
	Ross Lagerwall, Rafael J. Wysocki, Shatil Rafiullah, Vinson Lee

From: Ross Lagerwall <rosslagerwall@gmail.com>

commit 8673b83bf2f013379453b4779047bf3c6ae387e4 upstream.

Commit 4b31e774 (Always set P-state on initialization) 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.
Commit 5a1c0228 (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 <rosslagerwall@gmail.com>
Reviewed-by: Len Brown <len.brown@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Cc: 3.8+ <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ srafiullah: Backported to <= 3.6:
  - SYSTEM_AMD_MSR_CAPABLE does not exist. ]
Tested-by: Shatil Rafiullah <srafiullah@twopensource.com>
Signed-off-by: Shatil Rafiullah <srafiullah@twopensource.com>
Signed-off-by: Vinson Lee <vlee@twitter.com>
---
 drivers/cpufreq/acpi-cpufreq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 56c6c6b..227a316 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -215,7 +215,7 @@ 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_IO_CAPABLE:
 		cmd.type = SYSTEM_IO_CAPABLE;
-- 
1.8.3.2

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

* Re: [stable request <=3.7] acpi-cpufreq: set current frequency based on target P-State
  2014-03-25 22:04   ` [stable request <=3.7] " Vinson Lee
  2014-03-25 22:04     ` [PATCH] " Vinson Lee
@ 2014-03-25 22:18     ` rosslagerwall
  2014-03-25 22:53       ` Vinson Lee
  2014-04-11 16:05       ` Greg KH
  2014-03-31  8:50     ` Luís Henriques
  2 siblings, 2 replies; 9+ messages in thread
From: rosslagerwall @ 2014-03-25 22:18 UTC (permalink / raw)
  To: Vinson Lee
  Cc: stable, Rafael J. Wysocki, Viresh Kumar, cpufreq, linux-pm,
	Len Brown, Rafael J. Wysocki

On Tue, Mar 25, 2014 at 03:04:16PM -0700, Vinson Lee wrote:
> Hi.
> 
> Please backport upstream commit 8673b83bf2f013379453b4779047bf3c6ae387e4 
> "acpi-cpufreq: set current frequency based on target P-State" to stable 
> kernels 3.7 and earlier. This patch enables the kernel to control 
> P-states on several platforms. Without this patch, the kernel was unable 
> to control P-states on the same platforms.
> 
> The upstream patch cleanly applies to 3.7.
> 
> A backported patch is needed with the removal of SYSTEM_AMD_MSR_CAPABLE 
> for kernels 3.6 and earlier.
> 

I seem to recall that the problem was a regression introduced by commit
5a1c0228 (cpufreq: Avoid calling cpufreq driver's target() routine if
target_freq == policy->cur) which was introduced in the 3.8 cycle.  Are
you sure it is necessary for kernels < 3.8?

Regards
-- 
Ross Lagerwall

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

* Re: [stable request <=3.7] acpi-cpufreq: set current frequency based on target P-State
  2014-03-25 22:18     ` [stable request <=3.7] " rosslagerwall
@ 2014-03-25 22:53       ` Vinson Lee
  2014-03-26  7:22         ` rosslagerwall
  2014-04-11 16:05       ` Greg KH
  1 sibling, 1 reply; 9+ messages in thread
From: Vinson Lee @ 2014-03-25 22:53 UTC (permalink / raw)
  To: Ross Lagerwall
  Cc: stable, Rafael J. Wysocki, Viresh Kumar, cpufreq, linux-pm,
	Len Brown, Rafael J. Wysocki, Shatil Rafiullah

On Tue, Mar 25, 2014 at 3:18 PM,  <rosslagerwall@gmail.com> wrote:
> On Tue, Mar 25, 2014 at 03:04:16PM -0700, Vinson Lee wrote:
>> Hi.
>>
>> Please backport upstream commit 8673b83bf2f013379453b4779047bf3c6ae387e4
>> "acpi-cpufreq: set current frequency based on target P-State" to stable
>> kernels 3.7 and earlier. This patch enables the kernel to control
>> P-states on several platforms. Without this patch, the kernel was unable
>> to control P-states on the same platforms.
>>
>> The upstream patch cleanly applies to 3.7.
>>
>> A backported patch is needed with the removal of SYSTEM_AMD_MSR_CAPABLE
>> for kernels 3.6 and earlier.
>>
>
> I seem to recall that the problem was a regression introduced by commit
> 5a1c0228 (cpufreq: Avoid calling cpufreq driver's target() routine if
> target_freq == policy->cur) which was introduced in the 3.8 cycle.  Are
> you sure it is necessary for kernels < 3.8?
>
> Regards
> --
> Ross Lagerwall


This specific patch allows P-states to work with the 3.4 kernel on
several hardware platforms.

Perhaps this is not the correct patch to backport. However, P-states
are not working properly with the 3.4 kernel, even though it does not
have the regression commit 5a1c0228 "cpufreq: Avoid calling cpufreq
driver's target() routine if target_freq == policy->cur" backported.

Cheers,
Vinson

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

* Re: [stable request <=3.7] acpi-cpufreq: set current frequency based on target P-State
  2014-03-25 22:53       ` Vinson Lee
@ 2014-03-26  7:22         ` rosslagerwall
  0 siblings, 0 replies; 9+ messages in thread
From: rosslagerwall @ 2014-03-26  7:22 UTC (permalink / raw)
  To: Vinson Lee
  Cc: stable, Rafael J. Wysocki, Viresh Kumar, cpufreq, linux-pm,
	Len Brown, Rafael J. Wysocki, Shatil Rafiullah

On Tue, Mar 25, 2014 at 03:53:40PM -0700, Vinson Lee wrote:
> On Tue, Mar 25, 2014 at 3:18 PM,  <rosslagerwall@gmail.com> wrote:
> > On Tue, Mar 25, 2014 at 03:04:16PM -0700, Vinson Lee wrote:
> >> Hi.
> >>
> >> Please backport upstream commit 8673b83bf2f013379453b4779047bf3c6ae387e4
> >> "acpi-cpufreq: set current frequency based on target P-State" to stable
> >> kernels 3.7 and earlier. This patch enables the kernel to control
> >> P-states on several platforms. Without this patch, the kernel was unable
> >> to control P-states on the same platforms.
> >>
> >> The upstream patch cleanly applies to 3.7.
> >>
> >> A backported patch is needed with the removal of SYSTEM_AMD_MSR_CAPABLE
> >> for kernels 3.6 and earlier.
> >>
> >
> > I seem to recall that the problem was a regression introduced by commit
> > 5a1c0228 (cpufreq: Avoid calling cpufreq driver's target() routine if
> > target_freq == policy->cur) which was introduced in the 3.8 cycle.  Are
> > you sure it is necessary for kernels < 3.8?
> >
> > Regards
> > --
> > Ross Lagerwall
> 
> 
> This specific patch allows P-states to work with the 3.4 kernel on
> several hardware platforms.
> 
> Perhaps this is not the correct patch to backport. However, P-states
> are not working properly with the 3.4 kernel, even though it does not
> have the regression commit 5a1c0228 "cpufreq: Avoid calling cpufreq
> driver's target() routine if target_freq == policy->cur" backported.
> 

Fair enough,

Cheers
-- 
Ross Lagerwall

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

* Re: [stable request <=3.7] acpi-cpufreq: set current frequency based on target P-State
  2014-03-25 22:04   ` [stable request <=3.7] " Vinson Lee
  2014-03-25 22:04     ` [PATCH] " Vinson Lee
  2014-03-25 22:18     ` [stable request <=3.7] " rosslagerwall
@ 2014-03-31  8:50     ` Luís Henriques
  2 siblings, 0 replies; 9+ messages in thread
From: Luís Henriques @ 2014-03-31  8:50 UTC (permalink / raw)
  To: Vinson Lee
  Cc: stable, Rafael J. Wysocki, Viresh Kumar, cpufreq, linux-pm,
	Len Brown, Ross Lagerwall, Rafael J. Wysocki

On Tue, Mar 25, 2014 at 03:04:16PM -0700, Vinson Lee wrote:
> Hi.
> 
> Please backport upstream commit 8673b83bf2f013379453b4779047bf3c6ae387e4 
> "acpi-cpufreq: set current frequency based on target P-State" to stable 
> kernels 3.7 and earlier. This patch enables the kernel to control 
> P-states on several platforms. Without this patch, the kernel was unable 
> to control P-states on the same platforms.
> 
> The upstream patch cleanly applies to 3.7.
> 
> A backported patch is needed with the removal of SYSTEM_AMD_MSR_CAPABLE 
> for kernels 3.6 and earlier.
> 

Thank you, I'm queuing this backport to the 3.5 kernel.

Cheers,
--
Luís

> Cheers,
> Vinson
> 
> 
> Ross Lagerwall (1):
>   acpi-cpufreq: set current frequency based on target P-State
> 
>  drivers/cpufreq/acpi-cpufreq.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> -- 
> 1.8.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [stable request <=3.7] acpi-cpufreq: set current frequency based on target P-State
  2014-03-25 22:18     ` [stable request <=3.7] " rosslagerwall
  2014-03-25 22:53       ` Vinson Lee
@ 2014-04-11 16:05       ` Greg KH
  1 sibling, 0 replies; 9+ messages in thread
From: Greg KH @ 2014-04-11 16:05 UTC (permalink / raw)
  To: rosslagerwall
  Cc: Vinson Lee, stable, Rafael J. Wysocki, Viresh Kumar, cpufreq,
	linux-pm, Len Brown, Rafael J. Wysocki

On Tue, Mar 25, 2014 at 10:18:03PM +0000, rosslagerwall@gmail.com wrote:
> On Tue, Mar 25, 2014 at 03:04:16PM -0700, Vinson Lee wrote:
> > Hi.
> > 
> > Please backport upstream commit 8673b83bf2f013379453b4779047bf3c6ae387e4 
> > "acpi-cpufreq: set current frequency based on target P-State" to stable 
> > kernels 3.7 and earlier. This patch enables the kernel to control 
> > P-states on several platforms. Without this patch, the kernel was unable 
> > to control P-states on the same platforms.
> > 
> > The upstream patch cleanly applies to 3.7.
> > 
> > A backported patch is needed with the removal of SYSTEM_AMD_MSR_CAPABLE 
> > for kernels 3.6 and earlier.
> > 
> 
> I seem to recall that the problem was a regression introduced by commit
> 5a1c0228 (cpufreq: Avoid calling cpufreq driver's target() routine if
> target_freq == policy->cur) which was introduced in the 3.8 cycle.  Are
> you sure it is necessary for kernels < 3.8?

Given the lack of response here, I'm dropping these from my queue.  If
someone wants them back in, please resend after responding to this...

greg k-h

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

end of thread, other threads:[~2014-04-11 16:05 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20  2:14 [stable request <=3.5] acpi-cpufreq: set current frequency based on target P-State Vinson Lee
2013-12-20  8:19 ` Ross Lagerwall
2014-03-25 22:04   ` [stable request <=3.7] " Vinson Lee
2014-03-25 22:04     ` [PATCH] " Vinson Lee
2014-03-25 22:18     ` [stable request <=3.7] " rosslagerwall
2014-03-25 22:53       ` Vinson Lee
2014-03-26  7:22         ` rosslagerwall
2014-04-11 16:05       ` Greg KH
2014-03-31  8:50     ` Luís Henriques

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).