]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
cpufreq: intel_pstate: Read all MSRs on the target CPU
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 24 Oct 2022 19:21:00 +0000 (21:21 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 28 Nov 2022 14:18:06 +0000 (15:18 +0100)
commit6f845e4c9e896a15082c9ed29c830c0fe7ae9e10
tree45bfddf7bc5325e37e99c57e36b21a39a79e8b5b
parent9b3cf68a96e2099e9490fd65fbf6eaa12cfeb599
cpufreq: intel_pstate: Read all MSRs on the target CPU

BugLink: https://bugs.launchpad.net/bugs/1997981
commit 8dbab94d45fb1094cefac7956b7fb987a36e2b12 upstream.

Some of the MSR accesses in intel_pstate are carried out on the CPU
that is running the code, but the values coming from them are used
for the performance scaling of the other CPUs.

This is problematic, for example, on hybrid platforms where
MSR_TURBO_RATIO_LIMIT for P-cores and E-cores is different, so the
values read from it on a P-core are generally not applicable to E-cores
and the other way around.

For this reason, make the driver access all MSRs on the target CPU on
platforms using the "core" pstate_funcs callbacks which is the case for
all of the hybrid platforms released to date.  For this purpose, pass
a CPU argument to the ->get_max(), ->get_max_physical(), ->get_min()
and ->get_turbo() pstate_funcs callbacks and from there pass it to
rdmsrl_on_cpu() or rdmsrl_safe_on_cpu() to access the MSR on the target
CPU.

Fixes: 46573fd6369f ("cpufreq: intel_pstate: hybrid: Rework HWP calibration")
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/cpufreq/intel_pstate.c