summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShashank Balaji <shashank.mahadasyam@sony.com>2025-05-27 21:59:09 +0900
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2025-06-18 21:33:01 +0200
commit2e1185c9d7b4f890614e891ae1414653b35b88e3 (patch)
tree5db3f72ed64f6f8bb962ae6c2a79deab653c28ef
parentc83a92df2fc60bf0b3130cdf0bc2104d61750317 (diff)
cpufreq: userspace: set CPUFREQ_GOV_STRICT_TARGET flag
When the userspace governor is used, the user intends to set a fixed CPU frequency for a policy, for whatever reason. The CPUFREQ_GOV_STRICT_TARGET flag is the required behaviour. Without this flag, the intel_pstate driver, with HWP enabled, will set HWP_MIN_PERF to the target frequency and HWP_MAX_PERF to the policy maximum, when configuring the HWP_REQUEST MSR. This lets the hardware choose any frequency between the target frequency and the policy maximum, which is not the intended behaviour. To fix this, `cat scaling_setspeed > scaling_max_freq` had to be done. With this patch, that is no longer necessary. Setting scaling_setspeed is sufficient, as expected. Signed-off-by: Shashank Balaji <shashank.mahadasyam@sony.com> Link: https://patch.msgid.link/20250527-userspace-governor-doc-v2-1-0e22c69920f2@sony.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpufreq/cpufreq_userspace.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index 2c42fee76daa..77d62152cd38 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -134,6 +134,7 @@ static struct cpufreq_governor cpufreq_gov_userspace = {
.store_setspeed = cpufreq_set,
.show_setspeed = show_speed,
.owner = THIS_MODULE,
+ .flags = CPUFREQ_GOV_STRICT_TARGET,
};
MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>, "