Commit f0a0fc10 authored by Doug Smythies's avatar Doug Smythies Committed by Rafael J. Wysocki
Browse files

cpufreq: intel_pstate: fix pstate limits enforcement for adjust_perf call back



There is a loophole in pstate limit clamping for the intel_cpufreq CPU
frequency scaling driver (intel_pstate in passive mode), schedutil CPU
frequency scaling governor, HWP (HardWare Pstate) control enabled, when
the adjust_perf call back path is used.

Fix it.

Fixes: a365ab6b cpufreq: intel_pstate: Implement the ->adjust_perf() callback
Signed-off-by: default avatarDoug Smythies <dsmythies@telus.net>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent b401b621
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2987,6 +2987,9 @@ static void intel_cpufreq_adjust_perf(unsigned int cpunum,
	if (min_pstate < cpu->min_perf_ratio)
		min_pstate = cpu->min_perf_ratio;

	if (min_pstate > cpu->max_perf_ratio)
		min_pstate = cpu->max_perf_ratio;

	max_pstate = min(cap_pstate, cpu->max_perf_ratio);
	if (max_pstate < min_pstate)
		max_pstate = min_pstate;