cpufreq: intel_pstate: Use HWP if enabled by platform firmware
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 21 Apr 2021 17:40:56 +0000 (19:40 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 10 May 2021 11:22:39 +0000 (13:22 +0200)
commite5af36b2adb858e982d78d41d7363d05d951a19a
tree1949d48ad2f06a1e8f10a1fccf1194ba82403987
parent6efb943b8616ec53a5e444193dccf1af9ad627b5
cpufreq: intel_pstate: Use HWP if enabled by platform firmware

It turns out that there are systems where HWP is enabled during
initialization by the platform firmware (BIOS), but HWP EPP support
is not advertised.

After commit 7aa1031223bc ("cpufreq: intel_pstate: Avoid enabling HWP
if EPP is not supported") intel_pstate refuses to use HWP on those
systems, but the fallback PERF_CTL interface does not work on them
either because of enabled HWP, and once enabled, HWP cannot be
disabled.  Consequently, the users of those systems cannot control
CPU performance scaling.

Address this issue by making intel_pstate use HWP unconditionally if
it is enabled already when the driver starts.

Fixes: 7aa1031223bc ("cpufreq: intel_pstate: Avoid enabling HWP if EPP is not supported")
Reported-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Tested-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Cc: 5.9+ <stable@vger.kernel.org> # 5.9+
drivers/cpufreq/intel_pstate.c