Skip to contentSkip to conversation

cpufreq/intel_pstate: Fix calculation of current frequency

PATCH In review [email protected] 2 participants 2 messages Mar 22, 2013 – Mar 23, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpufreq/intel_pstate: Fix calculation of current frequency

From: Dirk Brandewie <[email protected]>

Use the correct pstate value to calculate the effective frequency.

https://bugzilla.redhat.com/show_bug.cgi?id=923942

---
 drivers/cpufreq/intel_pstate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/cpufreq/intel_pstate.c +1 -1
index e84af66..ad72922 100644
@@ -454,7 +454,7 @@ static inline void intel_pstate_calc_busy(struct cpudata *cpu,
 					sample->idletime_us * 100,
 					sample->duration_us);
 	core_pct = div64_u64(sample->aperf * 100, sample->mperf);
-	sample->freq = cpu->pstate.turbo_pstate * core_pct * 1000;
+	sample->freq = cpu->pstate.max_pstate * core_pct * 1000;
 
 	sample->core_pct_busy = div_s64((sample->pstate_pct_busy * core_pct),
 					100);
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 8 lines · On Friday, March 22, 2013 10:51:05 AM [email protected] wrote:

From: Dirk Brandewie <[email protected]>

Use the correct pstate value to calculate the effective frequency.

https://bugzilla.redhat.com/show_bug.cgi?id=923942

Well, another quick fix for v3.9 I suppose?

May I please be sent CCs of such things to at least one of my addresses?

Rafael

Quoted 18 lines
---
 drivers/cpufreq/intel_pstate.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/cpufreq/intel_pstate.c +1 -1
index e84af66..ad72922 100644
@@ -454,7 +454,7 @@ static inline void intel_pstate_calc_busy(struct cpudata *cpu,
 					sample->idletime_us * 100,
 					sample->duration_us);
 	core_pct = div64_u64(sample->aperf * 100, sample->mperf);
-	sample->freq = cpu->pstate.turbo_pstate * core_pct * 1000;
+	sample->freq = cpu->pstate.max_pstate * core_pct * 1000;
 
 	sample->core_pct_busy = div_s64((sample->pstate_pct_busy * core_pct),
 					100);
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.