Skip to content

Commit 2e1185c

Browse files
shashank-mahadasyamrafaeljw
authored andcommitted
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>
1 parent c83a92d commit 2e1185c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/cpufreq/cpufreq_userspace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ static struct cpufreq_governor cpufreq_gov_userspace = {
134134
.store_setspeed = cpufreq_set,
135135
.show_setspeed = show_speed,
136136
.owner = THIS_MODULE,
137+
.flags = CPUFREQ_GOV_STRICT_TARGET,
137138
};
138139

139140
MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>, "

0 commit comments

Comments
 (0)