Skip to content

Commit d51847a

Browse files
DougSmythiesrafaeljw
authored andcommitted
cpufreq: intel_pstate: set stale CPU frequency to minimum
The intel_pstate CPU frequency scaling driver does not use policy->cur and it is 0. When the CPU frequency is outdated arch_freq_get_on_cpu() will default to the nominal clock frequency when its call to cpufreq_quick_getpolicy_cur returns the never updated 0. Thus, the listed frequency might be outside of currently set limits. Some users are complaining about the high reported frequency, albeit stale, when their system is idle and/or it is above the reduced maximum they have set. This patch will maintain policy_cur for the intel_pstate driver at the current minimum CPU frequency. Reported-by: Yang Jie <yang.jie@linux.intel.com> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217597 Signed-off-by: Doug Smythies <dsmythies@telus.net> [ rjw: White space damage fixes and comment adjustment ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent ed95716 commit d51847a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/cpufreq/intel_pstate.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,6 +2609,11 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
26092609
intel_pstate_clear_update_util_hook(policy->cpu);
26102610
intel_pstate_hwp_set(policy->cpu);
26112611
}
2612+
/*
2613+
* policy->cur is never updated with the intel_pstate driver, but it
2614+
* is used as a stale frequency value. So, keep it within limits.
2615+
*/
2616+
policy->cur = policy->min;
26122617

26132618
mutex_unlock(&intel_pstate_limits_lock);
26142619

0 commit comments

Comments
 (0)