From: Shashank Balaji <shashank.mahadasyam@sony.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Jonathan Corbet <corbet@lwn.net>
Cc: linux-pm@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Shinya Takumi <shinya.takumi@sony.com>,
20250522-userspace-governor-doc-v1-1-c8a038e39084@sony.com,
Shashank Balaji <shashank.mahadasyam@sony.com>
Subject: [PATCH v2 1/2] cpufreq: userspace: set CPUFREQ_GOV_STRICT_TARGET flag
Date: Tue, 27 May 2025 21:59:09 +0900 [thread overview]
Message-ID: <20250527-userspace-governor-doc-v2-1-0e22c69920f2@sony.com> (raw)
In-Reply-To: <20250527-userspace-governor-doc-v2-0-0e22c69920f2@sony.com>
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>
---
drivers/cpufreq/cpufreq_userspace.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index 2c42fee76daa808f0cd1c7b1ab85476e695082e9..77d62152cd386d0eea69eba347b39f055ec860ce 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>, "
--
2.43.0
next prev parent reply other threads:[~2025-05-27 13:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-27 12:59 [PATCH v2 0/2] cpufreq: userspace: add " Shashank Balaji
2025-05-27 12:59 ` Shashank Balaji [this message]
2025-05-27 12:59 ` [PATCH v2 2/2] cpufreq, docs: userspace: mention variation in freq due to hw coordination Shashank Balaji
2025-06-17 10:14 ` [PATCH v2 0/2] cpufreq: userspace: add CPUFREQ_GOV_STRICT_TARGET flag Shashank Balaji
2025-06-18 19:35 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250527-userspace-governor-doc-v2-1-0e22c69920f2@sony.com \
--to=shashank.mahadasyam@sony.com \
--cc=20250522-userspace-governor-doc-v1-1-c8a038e39084@sony.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=shinya.takumi@sony.com \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®