Commit 43298db3 authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

cpufreq: intel_pstate: Refuse to turn off with HWP enabled

After commit f6ebbcf0 ("cpufreq: intel_pstate: Implement passive
mode with HWP enabled") it is possible to change the driver status
to "off" via sysfs with HWP enabled, which effectively causes the
driver to unregister itself, but HWP remains active and it forces the
minimum performance, so even if another cpufreq driver is loaded,
it will not be able to control the CPU frequency.

For this reason, make the driver refuse to change the status to
"off" with HWP enabled.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
parent f75aef39
...@@ -2716,9 +2716,15 @@ static int intel_pstate_update_status(const char *buf, size_t size) ...@@ -2716,9 +2716,15 @@ static int intel_pstate_update_status(const char *buf, size_t size)
{ {
int ret; int ret;
if (size == 3 && !strncmp(buf, "off", size)) if (size == 3 && !strncmp(buf, "off", size)) {
return intel_pstate_driver ? if (!intel_pstate_driver)
intel_pstate_unregister_driver() : -EINVAL; return -EINVAL;
if (hwp_active)
return -EBUSY;
return intel_pstate_unregister_driver();
}
if (size == 6 && !strncmp(buf, "active", size)) { if (size == 6 && !strncmp(buf, "active", size)) {
if (intel_pstate_driver) { if (intel_pstate_driver) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment