cpufreq / intel_pstate: Fix calculation of current frequency
authorDirk Brandewie <dirk.brandewie@gmail.com>
Sat, 23 Mar 2013 23:54:39 +0000 (00:54 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 25 Mar 2013 14:12:59 +0000 (15:12 +0100)
Use the correct pstate value to calculate the effective frequency.

References: https://bugzilla.redhat.com/show_bug.cgi?id=923942
Reported-by: Satish Balay <balay@fastmail.fm>
Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c

index cd9c5f4f580563a96db8773580be6916771df07f..b662529072f79aaf22c24f0e6d0b3697da86e2f0 100644 (file)
@@ -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);