Skip to contentSkip to conversation

fix intel_pstate to update MSR values when changing governors

PATCH Superseded Alexandra Yates 2 participants 3 messages Oct 17, 2015 – Nov 18, 2015

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix intel_pstate to update MSR values when changing governors

From: root <[email protected]>

When changing from powersave to performance governors Intel_pstate fails to update the MSR values that reflect the max_perf_pct to 100%. For instance:

Governor MSR max_perf_pct
========= ==== ============
Powersave 2828 100%
Powersave 2028 80%
Performance 2028 100% <-

The arrow shows the culprit. At this point the MSR should reflect the max_perf_pct that is 100% that corresponds MSR 2828 the maximum performance for the Performance governor. Instead it holds back the MSR value previously set
by the Powersave governor 2028.

---
 drivers/cpufreq/intel_pstate.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/intel_pstate.c +2 -0
index cde38c8..992dbb5 100644
@@ -1239,6 +1239,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
 	    policy->max >= policy->cpuinfo.max_freq) {
 		pr_debug("intel_pstate: set performance\n");
 		limits = &performance_limits;
+		if (hwp_active)
+			intel_pstate_hwp_set();
 		return 0;
 	}
 
Signature · 1 line
2.4.3
#1 lore raw

Hi,

Quoted 12 lines · Alexandra Yates

From: root <[email protected]>

When changing from powersave to performance governors Intel_pstate fails to update the MSR values that reflect the max_perf_pct to 100%. For instance:

Governor        MSR     max_perf_pct
=========       ====    ============
Powersave       2828    100%
Powersave       2028    80%
Performance     2028    100% <-
Quoted 7 lines

The arrow shows the culprit. At this point the MSR should reflect the max_perf_pct that is 100% that corresponds MSR 2828 the maximum performance for the Performance governor. Instead it holds back the MSR value previously set
by the Powersave governor 2028.

It looks like you need to update your git configuration.

More to the point, I wonder if this commit addresses the problem your seeing:

http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=51443fbf3d2cde16011b994252c8004ebcd66fb0

Quoted 9 lines
---
 drivers/cpufreq/intel_pstate.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/intel_pstate.c +0 -0
index cde38c8..992dbb5 100644

drivers/cpufreq/intel_pstate.c static int intel_pstate_set_policy(struct cpufreq_policy *policy)

Quoted 9 lines
drivers/cpufreq/intel_pstate.c +2 -1
@@ -1239,6 +1239,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
            policy->max >= policy->cpuinfo.max_freq) {
                pr_debug("intel_pstate: set performance\n");
                limits = &performance_limits;
+               if (hwp_active)
+                       intel_pstate_hwp_set();
                return 0;
        }
 
--

Thanks,
Rafael

#2 lore raw
Quoted 24 lines · Rafael J. Wysocki

Hi,

Quoted 19 lines · Alexandra Yates

From: root <[email protected]>

When changing from powersave to performance governors Intel_pstate fails to update the MSR values that reflect the max_perf_pct to 100%. For instance:

Governor        MSR     max_perf_pct
=========       ====    ============
Powersave       2828    100%
Powersave       2028    80%
Performance     2028    100% <-

The arrow shows the culprit. At this point the MSR should reflect the max_perf_pct that is 100% that corresponds MSR 2828 the maximum performance for the Performance governor. Instead it holds back the MSR value previously set
by the Powersave governor 2028.

Sorry about this I sent the patch against an internal tree. Won't happen again.

Quoted 4 lines

It looks like you need to update your git configuration.

More to the point, I wonder if this commit addresses the problem your seeing:

I tested only with the following patch in question and it doesn't fix the error for the MSR values on SKL. I'm resending my patch rebased to linux-pm, including a better explanation on what the error is and what is fixing.

Quoted 24 lines

http://git.kernel.org/cgit/linux/kernel/git/rafael/linux-pm.git/commit/?h=bleeding-edge&id=51443fbf3d2cde16011b994252c8004ebcd66fb0

Quoted 9 lines
---
  drivers/cpufreq/intel_pstate.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/cpufreq/intel_pstate.c +0 -0
index cde38c8..992dbb5 100644

drivers/cpufreq/intel_pstate.c static int intel_pstate_set_policy(struct cpufreq_policy *policy)

Quoted 9 lines
drivers/cpufreq/intel_pstate.c +2 -1
@@ -1239,6 +1239,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
             policy->max >= policy->cpuinfo.max_freq) {
                 pr_debug("intel_pstate: set performance\n");
                 limits = &performance_limits;
+               if (hwp_active)
+                       intel_pstate_hwp_set();
                 return 0;
         }
 
--

Thanks,
Rafael

Signature · 2 lines
Thank you,
<Alexandra>