Skip to content

Commit b49a519

Browse files
committed
Merge tag 'pm+acpi-4.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki: "One revert of a recent cpufreq commit that introduced a regression and a fix for intel_pstate's Turbo Activation Ratio handling code. Specifics: - Revert cpufreq commit that attempted to fix a problem in the ondemand/conservative governor code, but did that incorrectly and introduced another problem instead (Rafael Wysocki). - Fix incorrect decoding of MSR contents related to the Turbo Activation Ratio (TAR) handling in the intel_pstate driver (Srinivas Pandruvada)" * tag 'pm+acpi-4.6-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpufreq: intel_pstate: Fix processing for turbo activation ratio Revert "cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC"
2 parents a8feb78 + 81be193 commit b49a519

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

drivers/cpufreq/cpufreq_governor.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,8 @@ unsigned int dbs_update(struct cpufreq_policy *policy)
193193
wall_time = cur_wall_time - j_cdbs->prev_cpu_wall;
194194
j_cdbs->prev_cpu_wall = cur_wall_time;
195195

196-
if (cur_idle_time <= j_cdbs->prev_cpu_idle) {
197-
idle_time = 0;
198-
} else {
199-
idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
200-
j_cdbs->prev_cpu_idle = cur_idle_time;
201-
}
196+
idle_time = cur_idle_time - j_cdbs->prev_cpu_idle;
197+
j_cdbs->prev_cpu_idle = cur_idle_time;
202198

203199
if (ignore_nice) {
204200
u64 cur_nice = kcpustat_cpu(j).cpustat[CPUTIME_NICE];

drivers/cpufreq/intel_pstate.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,11 @@ static int core_get_max_pstate(void)
813813
if (err)
814814
goto skip_tar;
815815

816+
/* For level 1 and 2, bits[23:16] contain the ratio */
817+
if (tdp_ctrl)
818+
tdp_ratio >>= 16;
819+
820+
tdp_ratio &= 0xff; /* ratios are only 8 bits long */
816821
if (tdp_ratio - 1 == tar) {
817822
max_pstate = tar;
818823
pr_debug("max_pstate=TAC %x\n", max_pstate);

0 commit comments

Comments
 (0)