From: "Rafael J. Wysocki" <rafael@kernel.org>
To: linux-pm@vger.kernel.org
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Doug Smythies <dsmythies@telus.net>,
linux-kernel@vger.kernel.org
Subject: [PATCH v1] cpufreq: intel_pstate: Avoid using DESIRED_PERF when DEC is enabled
Date: Mon, 03 Aug 2026 20:15:20 +0200 [thread overview]
Message-ID: <5091298.GXAFRqVoOG@rafael.j.wysocki> (raw)
In-Reply-To: <20260729-bug-intel-pstate-policy-cur-v1-1-51f61e5cbd74@gmail.com>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
In principle, the desired performance level can be set in MSR_HWP_REQUEST
to indicate to the processor what performance level the OS would like
the given CPU to run at, but if the Dynamic Efficiency Control (DEC)
feature is enabled in the processor, doing so may result in confusing
the processor firmware. It is then better to let the processor firmware
figure out the most suitable performance level by itself.
Accordingly, make intel_pstate always set the desired performance level
to zero (which means "no preference") when running on a platform with
DEC enabled.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
Applies on top of linux-next.
---
drivers/cpufreq/intel_pstate.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -303,6 +303,7 @@ static bool per_cpu_limits __ro_after_in
static bool hwp_forced __ro_after_init;
static bool hwp_boost __read_mostly;
static bool hwp_is_hybrid;
+static u32 hwp_desired_mask __read_mostly = ~0U;
static struct cpufreq_driver *intel_pstate_driver __read_mostly;
@@ -3150,7 +3151,7 @@ static void intel_cpufreq_hwp_update(str
value |= HWP_MAX_PERF(max);
value &= ~HWP_DESIRED_PERF(~0L);
- value |= HWP_DESIRED_PERF(desired);
+ value |= HWP_DESIRED_PERF(desired & hwp_desired_mask);
if (value == prev)
return;
@@ -3787,6 +3788,7 @@ static int __init intel_pstate_init(void
id = x86_match_cpu(hwp_support_ids);
if (id) {
bool epp_present = hwp_check_epp();
+ bool dec_present = hwp_check_dec();
/*
* If HWP is enabled already, there is no choice but to deal
@@ -3798,7 +3800,7 @@ static int __init intel_pstate_init(void
no_hwp = 0;
} else if (no_load) {
return -ENODEV;
- } else if (!epp_present && !hwp_check_dec()) {
+ } else if (!epp_present && !dec_present) {
/*
* Avoid enabling HWP for processors without EPP support
* unless the Dynamic Efficiency Control (DEC) enable
@@ -3820,6 +3822,9 @@ static int __init intel_pstate_init(void
if (!default_driver)
default_driver = &intel_pstate;
+ if (dec_present)
+ hwp_desired_mask = 0;
+
if (!id->driver_data)
pstate_funcs.get_cpu_scaling = hwp_get_cpu_scaling;
next prev parent reply other threads:[~2026-08-03 18:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 8:59 [PATCH] cpufreq: intel_pstate: Sync policy->cur to the pinned pstate Jing Wu
2026-07-29 18:40 ` [PATCH v1] cpufreq: intel_pstate: Adjust policy->cur in active mode to policy Rafael J. Wysocki
2026-07-29 23:29 ` Doug Smythies
2026-07-30 15:01 ` Doug Smythies
2026-07-31 17:05 ` Rafael J. Wysocki (Intel)
2026-07-31 17:20 ` srinivas pandruvada
2026-08-03 18:15 ` Rafael J. Wysocki [this message]
2026-08-04 17:58 ` [PATCH v1] cpufreq: intel_pstate: Avoid using DESIRED_PERF when DEC is enabled srinivas pandruvada
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=5091298.GXAFRqVoOG@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=dsmythies@telus.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=srinivas.pandruvada@linux.intel.com \
/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