]> git.baikalelectronics.ru Git - kernel.git/commit
cpufreq: intel_pstate: hybrid: Rework HWP calibration
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Sat, 4 Sep 2021 13:53:39 +0000 (15:53 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 7 Sep 2021 19:15:16 +0000 (21:15 +0200)
commitad94a3e7bfbc177af473ecf67e112f264d6cd041
treeaa3d028fac29d73d72b85e090a87f1f478df0b35
parent698a3bb9d8e02bed646caf530982ebc08f6c76d4
cpufreq: intel_pstate: hybrid: Rework HWP calibration

The current HWP calibration for hybrid processors in intel_pstate is
fragile, because it depends too much on the information provided by
the platform firmware via CPPC which may not be reliable enough.  It
also need not be so complicated.

In order to improve that mechanism and make it more resistant to
platform firmware issues, make it only use the CPPC nominal_perf
values to compute the HWP-to-frequency scaling factors for all
CPUs and possibly use the HWP_CAP highest_perf values to recompute
them if the ones derived from the CPPC nominal_perf values alone
appear to be too high.

Namely, fetch CPC.nominal_perf for all CPUs present in the system,
find the minimum one and use it as a reference for computing all of
the CPUs' scaling factors (using the observation that for the CPUs
having the minimum CPC.nominal_perf the HWP range of available
performance levels should be the same as the range of available
"legacy" P-states and so the HWP-to-frequency scaling factor for
them should be the same as the corresponding scaling factor used
for representing the P-state values in kHz).

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Zhang Rui <rui.zhang@intel.com>
drivers/cpufreq/intel_pstate.c