cpufreq: intel_pstate: hybrid: Use known scaling factor for P-cores
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 24 Oct 2022 19:22:48 +0000 (21:22 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 25 Oct 2022 13:09:23 +0000 (15:09 +0200)
commitf5c8cf2a4992dd929fa0c2f25c09ee69b8dcbce1
treebb6c270861241c58fedb279de7fa1643631816d5
parent8dbab94d45fb1094cefac7956b7fb987a36e2b12
cpufreq: intel_pstate: hybrid: Use known scaling factor for P-cores

Commit 46573fd6369f ("cpufreq: intel_pstate: hybrid: Rework HWP
calibration") attempted to use the information from CPPC (the nominal
performance in particular) to obtain the scaling factor allowing the
frequency to be computed if the HWP performance level of the given CPU
is known or vice versa.

However, it turns out that on some platforms this doesn't work, because
the CPPC information on them does not align with the contents of the
MSR_HWP_CAPABILITIES registers.

This basically means that the only way to make intel_pstate work on all
of the hybrid platforms to date is to use the observation that on all
of them the scaling factor between the HWP performance levels and
frequency for P-cores is 78741 (approximately 100000/1.27).  For
E-cores it is 100000, which is the same as for all of the non-hybrid
"core" platforms and does not require any changes.

Accordingly, make intel_pstate use 78741 as the scaling factor between
HWP performance levels and frequency for P-cores on all hybrid platforms
and drop the dependency of the HWP calibration code on CPPC.

Fixes: 46573fd6369f ("cpufreq: intel_pstate: hybrid: Rework HWP calibration")
Reported-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: 5.15+ <stable@vger.kernel.org> # 5.15+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/intel_pstate.c