From: "Chen, Yu C" <yu.c.chen@intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
LKML <linux-kernel@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>,
Chen Yu <yu.c.chen@intel.com>
Subject: Re: [PATCH v1] cpufreq: intel_pstate: Skip HWP_CAP reads in Broadwell mode
Date: Mon, 22 Jun 2026 23:16:41 +0800 [thread overview]
Message-ID: <1372adf9-2356-4d0c-915d-3660efd99988@intel.com> (raw)
In-Reply-To: <12920597.O9o76ZdvQC@rafael.j.wysocki>
Hi Rafael,
On 6/20/2026 3:24 AM, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> When running in the Broadwell HWP mode, the turbo, max and min
> P-state values are retrieved from MSR_PLATFORM_INFO, so reading
> MSR_HWP_CAPABILITIES in that mode in order to update those values
> is pointless. Moreover, using the MSR_HWP_CAPABILITIES value for
> updating them in the Broadwell mode may be harmful, so avoid doing
> that altogether.
>
> Fixes: de5bcf404ace ("cpufreq: intel_pstate: Clean up frequency computations")
sashiko[1] reports an issue that hwp_cap_cached remains 0.
Maybe still use the value from MSR_HWP_CAPABILITIES for cached value,
which was what we did before commit de5bcf404ace? I fed this
to AI and was given the following:
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 5a0eeb84d382..a373a199c9c6 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1189,6 +1189,8 @@ static void __intel_pstate_get_hwp_cap(struct
cpudata *cpu)
rdmsrq_on_cpu(cpu->cpu, MSR_HWP_CAPABILITIES, &cap);
WRITE_ONCE(cpu->hwp_cap_cached, cap);
+ if (hwp_mode_bdw)
+ return;
cpu->pstate.max_pstate = HWP_GUARANTEED_PERF(cap);
cpu->pstate.turbo_pstate = HWP_HIGHEST_PERF(cap);
}
@@ -1199,6 +1201,9 @@ static void intel_pstate_get_hwp_cap(struct
cpudata *cpu)
__intel_pstate_get_hwp_cap(cpu);
+ if (hwp_mode_bdw)
+ return;
+
cpu->pstate.max_freq = cpu->pstate.max_pstate * scaling;
cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * scaling;
if (scaling != cpu->pstate.perf_ctl_scaling) {
[1] https://sashiko.dev/#/patchset/12920597.O9o76ZdvQC%40rafael.j.wysocki
thanks,
Chenyu
next prev parent reply other threads:[~2026-06-22 15:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-19 19:24 Rafael J. Wysocki
2026-06-21 21:38 ` srinivas pandruvada
2026-06-22 16:38 ` Rafael J. Wysocki
2026-06-22 15:16 ` Chen, Yu C [this message]
2026-06-22 17:00 ` 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=1372adf9-2356-4d0c-915d-3660efd99988@intel.com \
--to=yu.c.chen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@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
all inboxes | Powered by JetHome®