Linux Power Management development
 help / color / mirror / Atom feed
From: Henry Tseng <henrytseng@qnap.com>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org, SW Chen <swchen@qnap.com>,
	Kevin Ko <kevinko@qnap.com>, Henry Tseng <henrytseng@qnap.com>
Subject: [PATCH v2 1/2] cpufreq: intel_pstate: Fix scaling for hybrid-capable CPUs not reporting hybrid
Date: Fri,  8 May 2026 14:30:31 +0800	[thread overview]
Message-ID: <20260508063032.3248602-2-henrytseng@qnap.com> (raw)
In-Reply-To: <20260508063032.3248602-1-henrytseng@qnap.com>

Commit 9b18d536b124 ("cpufreq: intel_pstate: Use CPPC to get scaling
factors") restructured hwp_get_cpu_scaling() so that, when the CPU
model is registered in intel_hybrid_scaling_factor[] and
hybrid_get_cpu_type() does not return INTEL_CPU_TYPE_CORE, the
function early-returns core_get_scaling() (100000) instead of
falling through to intel_pstate_cppc_get_scaling().

This regresses the behavior previously addressed by
commit 0fcfc9e51990 ("cpufreq: intel_pstate: Fix scaling for
hybrid-capable systems with disabled E-cores").  On hybrid-capable
processors not reporting X86_FEATURE_HYBRID_CPU (no E-cores
enumerated), hybrid_get_cpu_type() returns 0.  Before 9b18d536b124,
such CPUs fell through to intel_pstate_cppc_get_scaling(), which
returned the registered hybrid_scaling_factor.  After 9b18d536b124,
for models registered in the table the early return takes
core_get_scaling() before reaching that fallback, so the registered
factor is not used.

Fix this by returning hybrid_scaling_factor directly for CPU models
registered in intel_hybrid_scaling_factor[] that do not report
X86_FEATURE_HYBRID_CPU, before checking hybrid_get_cpu_type().

With that fix, non-hybrid CPUs in the table now reach
intel_pstate_hybrid_hwp_adjust() with scaling != perf_ctl_scaling.
Since commit 5313ec4a215a ("cpufreq: intel_pstate: Improve printing of
debug messages") sets hwp_is_hybrid = true unconditionally inside that
function, set hwp_is_hybrid based on X86_FEATURE_HYBRID_CPU instead,
so the flag is not set on non-hybrid systems.

Fixes: 9b18d536b124 ("cpufreq: intel_pstate: Use CPPC to get scaling factors")
Signed-off-by: Henry Tseng <henrytseng@qnap.com>
---
 drivers/cpufreq/intel_pstate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 1292da53e5fc..d39592e86570 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -585,7 +585,7 @@ static void intel_pstate_hybrid_hwp_adjust(struct cpudata *cpu)
 	if (scaling == perf_ctl_scaling)
 		return;
 
-	hwp_is_hybrid = true;
+	hwp_is_hybrid = cpu_feature_enabled(X86_FEATURE_HYBRID_CPU);
 
 	cpu->pstate.turbo_freq = rounddown(cpu->pstate.turbo_pstate * scaling,
 					   perf_ctl_scaling);
@@ -2275,6 +2275,9 @@ static int knl_get_turbo_pstate(int cpu)
 static int hwp_get_cpu_scaling(int cpu)
 {
 	if (hybrid_scaling_factor) {
+		if (!cpu_feature_enabled(X86_FEATURE_HYBRID_CPU))
+			return hybrid_scaling_factor;
+
 		/*
 		 * Return the hybrid scaling factor for P-cores and use the
 		 * default core scaling for E-cores.
-- 
2.43.0


  reply	other threads:[~2026-05-08  6:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-08  6:30 [PATCH v2 0/2] cpufreq: intel_pstate: Add scaling factor for Bartlett Lake P-core only SKUs Henry Tseng
2026-05-08  6:30 ` Henry Tseng [this message]
2026-05-10 14:34   ` [PATCH v2 1/2] cpufreq: intel_pstate: Fix scaling for hybrid-capable CPUs not reporting hybrid srinivas pandruvada
2026-05-08  6:30 ` [PATCH v2 2/2] cpufreq: intel_pstate: Use HYBRID_SCALING_FACTOR_ADL for Bartlett Lake Henry Tseng

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=20260508063032.3248602-2-henrytseng@qnap.com \
    --to=henrytseng@qnap.com \
    --cc=kevinko@qnap.com \
    --cc=lenb@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=swchen@qnap.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