cpufreq: intel_pstate: Get per-CPU max freq via MSR_HWP_CAPABILITIES if available
authorChen Yu <yu.c.chen@intel.com>
Tue, 12 Jan 2021 05:21:27 +0000 (13:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 09:26:50 +0000 (10:26 +0100)
commit07332771663b0a5eafef7097c11cf919c7d6f90b
tree54ddbd8d700276c82f02b0246867c37893076f9f
parentdfbbed769f1b7197e79fbd7a61c6627753b0b674
cpufreq: intel_pstate: Get per-CPU max freq via MSR_HWP_CAPABILITIES if available

commit 6f67e060083a84a4cc364eab6ae40c717165fb0c upstream.

Currently, when turbo is disabled (either by BIOS or by the user),
the intel_pstate driver reads the max non-turbo frequency from the
package-wide MSR_PLATFORM_INFO(0xce) register.

However, on asymmetric platforms it is possible in theory that small
and big core with HWP enabled might have different max non-turbo CPU
frequency, because MSR_HWP_CAPABILITIES is per-CPU scope according
to Intel Software Developer Manual.

The turbo max freq is already per-CPU in current code, so make
similar change to the max non-turbo frequency as well.

Reported-by: Wendy Wang <wendy.wang@intel.com>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
[ rjw: Subject and changelog edits ]
Cc: 4.18+ <stable@vger.kernel.org> # 4.18+: a45ee4d4e13b: cpufreq: intel_pstate: Change intel_pstate_get_hwp_max() argument
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/cpufreq/intel_pstate.c