Skip to content

Commit 81be193

Browse files
committed
Merge branch 'pm-cpufreq-fixes'
* pm-cpufreq-fixes: cpufreq: intel_pstate: Fix processing for turbo activation ratio Revert "cpufreq: governor: Fix negative idle_time when configured with CONFIG_HZ_PERIODIC"
2 parents 02da2d7 + 1becf03 commit 81be193

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)