cpufreq: intel_pstate: fix pstate limits enforcement for adjust_perf call back
Subsystems (2)
PATCH 1/1 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.
Signed-off-by Doug Smythies <[email protected]>
--- drivers/cpufreq/intel_pstate.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/cpufreq/intel_pstate.c +3 -0
@@ -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;
Signature · 1 line
2.25.1
Quoted 18 lines · Doug Smythies
There is a loophole in pstate limit clamping for the
intel_cpufreqCPU frequency scaling driver (intel_pstatein passive mode), schedutil CPU frequency scaling governor, HWP (HardWare Pstate) control enabled, when theadjust_perfcall back path is used.Fix it.
Signed-off-by Doug Smythies <[email protected]>--- drivers/cpufreq/intel_pstate.c | 3 +++ 1 file changed, 3 insertions(+)drivers/cpufreq/intel_pstate.c +0
-0
drivers/cpufreq/intel_pstate.c static void intel_cpufreq_adjust_perf(unsigned int cpunum,
Quoted 10 lines
drivers/cpufreq/intel_pstate.c +3
-1@@ -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; --
Applied as 6.9 material, thanks!