cpufreq: intel_pstate: Refine computation of P-state for given frequency
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 Jan 2024 14:18:11 +0000 (15:18 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 Jan 2024 14:18:11 +0000 (15:18 +0100)
commit192cdb1c907fd8df2d764c5bb17496e415e59391
tree152078ef78fb2b9a7b48f146792f68eb5ccbcbcf
parent6613476e225e090cc9aad49be7fa504e290dd33d
cpufreq: intel_pstate: Refine computation of P-state for given frequency

On systems using HWP, if a given frequency is equal to the maximum turbo
frequency or the maximum non-turbo frequency, the HWP performance level
corresponding to it is already known and can be used directly without
any computation.

Accordingly, adjust the code to use the known HWP performance levels in
the cases mentioned above.

This also helps to avoid limiting CPU capacity artificially in some
cases when the BIOS produces the HWP_CAP numbers using a different
E-core-to-P-core performance scaling factor than expected by the kernel.

Fixes: f5c8cf2a4992 ("cpufreq: intel_pstate: hybrid: Use known scaling factor for P-cores")
Cc: 6.1+ <stable@vger.kernel.org> # 6.1+
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c