Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v2 0/2] cpufreq: intel_pstate: Add scaling factor for Bartlett Lake P-core only SKUs
@ 2026-05-08  6:30 Henry Tseng
  2026-05-08  6:30 ` [PATCH v2 1/2] cpufreq: intel_pstate: Fix scaling for hybrid-capable CPUs not reporting hybrid Henry Tseng
  2026-05-08  6:30 ` [PATCH v2 2/2] cpufreq: intel_pstate: Use HYBRID_SCALING_FACTOR_ADL for Bartlett Lake Henry Tseng
  0 siblings, 2 replies; 4+ messages in thread
From: Henry Tseng @ 2026-05-08  6:30 UTC (permalink / raw)
  To: Srinivas Pandruvada, Rafael J. Wysocki, Len Brown, Viresh Kumar
  Cc: linux-pm, SW Chen, Kevin Ko, Henry Tseng

On Bartlett Lake P-core only SKUs (e.g. Intel Core 9 273PE),
cpuinfo_max_freq is reported as 7.0/7.3 GHz, exceeding the datasheet
Max Turbo Frequency of 5.7 GHz.  Root cause: hwp_get_cpu_scaling()
returns 100000 (default core scaling) instead of the correct factor
78741.

Patch 1 fixes a framework regression introduced by 9b18d536b124,
where the registered hybrid_scaling_factor is bypassed for
table-registered models not reporting X86_FEATURE_HYBRID_CPU.
Patch 1 must apply before patch 2; the Bartlett Lake entry alone has
no effect on these SKUs without the framework fix.

Patch 2 adds Bartlett Lake to intel_hybrid_scaling_factor[] with
HYBRID_SCALING_FACTOR_ADL.

---
v2:
  - Reuse intel_hybrid_scaling_factor[] with HYBRID_SCALING_FACTOR_ADL
    instead of introducing a new intel_cppc_scaling_ids[] table and
    computing the scaling factor via CPPC at runtime.
  - Split into two patches: framework fix + Bartlett Lake entry.
v1:
  - https://lore.kernel.org/linux-pm/20260506095157.1591221-1-henrytseng@qnap.com/

Henry Tseng (2):
  cpufreq: intel_pstate: Fix scaling for hybrid-capable CPUs not
    reporting hybrid
  cpufreq: intel_pstate: Use HYBRID_SCALING_FACTOR_ADL for Bartlett Lake

 drivers/cpufreq/intel_pstate.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 1/2] cpufreq: intel_pstate: Fix scaling for hybrid-capable CPUs not reporting hybrid
  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
  2026-05-10 14:34   ` srinivas pandruvada
  2026-05-08  6:30 ` [PATCH v2 2/2] cpufreq: intel_pstate: Use HYBRID_SCALING_FACTOR_ADL for Bartlett Lake Henry Tseng
  1 sibling, 1 reply; 4+ messages in thread
From: Henry Tseng @ 2026-05-08  6:30 UTC (permalink / raw)
  To: Srinivas Pandruvada, Rafael J. Wysocki, Len Brown, Viresh Kumar
  Cc: linux-pm, SW Chen, Kevin Ko, Henry Tseng

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v2 2/2] cpufreq: intel_pstate: Use HYBRID_SCALING_FACTOR_ADL for Bartlett Lake
  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 ` [PATCH v2 1/2] cpufreq: intel_pstate: Fix scaling for hybrid-capable CPUs not reporting hybrid Henry Tseng
@ 2026-05-08  6:30 ` Henry Tseng
  1 sibling, 0 replies; 4+ messages in thread
From: Henry Tseng @ 2026-05-08  6:30 UTC (permalink / raw)
  To: Srinivas Pandruvada, Rafael J. Wysocki, Len Brown, Viresh Kumar
  Cc: linux-pm, SW Chen, Kevin Ko, Henry Tseng

Bartlett Lake shares the same HWP-to-PERF_CTL scaling factor as Alder
Lake / Raptor Lake P-cores.  Add Bartlett Lake to
intel_hybrid_scaling_factor[] with HYBRID_SCALING_FACTOR_ADL so HWP
performance levels map to the correct CPU frequencies.

Per the Intel datasheet [1], the Intel Core 9 273PE specifies:

  Performance-cores:                                 12
  Efficient-cores:                                   0
  Max Turbo Frequency:                               5.7 GHz
  Intel Thermal Velocity Boost Frequency:            5.7 GHz
  Intel Turbo Boost Max Technology 3.0 Frequency:    5.6 GHz
  Performance-core Max Turbo Frequency:              5.4 GHz
  Performance-core Base Frequency:                   2.3 GHz

Because this CPU has no E-cores and does not report
X86_FEATURE_HYBRID_CPU, hwp_get_cpu_scaling() returns 100000 (the
default core scaling).  In intel_pstate_get_cpu_pstates(), the
condition cpu->pstate.scaling == perf_ctl_scaling then takes the
early path that simply multiplies HWP performance levels by 100000,
producing cpuinfo_max_freq values that exceed the documented Max
Turbo Frequency:

  intel_pstate: CPU0: PERF_CTL turbo = 57
  intel_pstate: CPU0: HWP_CAP guaranteed = 30
  intel_pstate: CPU0: HWP_CAP highest = 70
  intel_pstate: CPU0: HWP-to-frequency scaling factor: 100000
  intel_pstate: set_policy cpuinfo.max 7000000 policy->max 7000000
  ...
  intel_pstate: CPU12: HWP_CAP highest = 73
  intel_pstate: CPU12: HWP-to-frequency scaling factor: 100000
  intel_pstate: set_policy cpuinfo.max 7300000 policy->max 7300000

With this patch, the registered HYBRID_SCALING_FACTOR_ADL (78741) is
used:

  intel_pstate: hybrid scaling factor: 78741
  intel_pstate: CPU0: PERF_CTL turbo = 57
  intel_pstate: CPU0: HWP_CAP guaranteed = 30
  intel_pstate: CPU0: HWP_CAP highest = 70
  intel_pstate: CPU0: HWP-to-frequency scaling factor: 78741
  intel_pstate: set_policy cpuinfo.max 5500000 policy->max 5500000
  ...
  intel_pstate: CPU12: HWP_CAP highest = 73
  intel_pstate: CPU12: HWP-to-frequency scaling factor: 78741
  intel_pstate: set_policy cpuinfo.max 5700000 policy->max 5700000

The reported cpuinfo_max_freq (5.5/5.7 GHz) now matches the
datasheet's Max Turbo Frequency.

[1] https://www.intel.com/content/www/us/en/products/sku/245717/intel-core-9-processor-273pe-36m-cache-up-to-5-70-ghz/specifications.html

Signed-off-by: Henry Tseng <henrytseng@qnap.com>
---
 drivers/cpufreq/intel_pstate.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index d39592e86570..82e82a70cacb 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -3737,6 +3737,7 @@ static const struct x86_cpu_id intel_hybrid_scaling_factor[] = {
 	X86_MATCH_VFM(INTEL_RAPTORLAKE, HYBRID_SCALING_FACTOR_ADL),
 	X86_MATCH_VFM(INTEL_RAPTORLAKE_P, HYBRID_SCALING_FACTOR_ADL),
 	X86_MATCH_VFM(INTEL_RAPTORLAKE_S, HYBRID_SCALING_FACTOR_ADL),
+	X86_MATCH_VFM(INTEL_BARTLETTLAKE, HYBRID_SCALING_FACTOR_ADL),
 	X86_MATCH_VFM(INTEL_METEORLAKE_L, HYBRID_SCALING_FACTOR_MTL),
 	X86_MATCH_VFM(INTEL_LUNARLAKE_M, HYBRID_SCALING_FACTOR_LNL),
 	{}
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 1/2] cpufreq: intel_pstate: Fix scaling for hybrid-capable CPUs not reporting hybrid
  2026-05-08  6:30 ` [PATCH v2 1/2] cpufreq: intel_pstate: Fix scaling for hybrid-capable CPUs not reporting hybrid Henry Tseng
@ 2026-05-10 14:34   ` srinivas pandruvada
  0 siblings, 0 replies; 4+ messages in thread
From: srinivas pandruvada @ 2026-05-10 14:34 UTC (permalink / raw)
  To: Henry Tseng, Rafael J. Wysocki, Len Brown, Viresh Kumar
  Cc: linux-pm, SW Chen, Kevin Ko

On Fri, 2026-05-08 at 14:30 +0800, Henry Tseng wrote:
> 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;

It breaks Alder Lake systems with only E-cores and no P-cores. So need
to think about this. So this change didn't restore the behavior of
0fcfc9e51990.
So need to think about this.

Thanks,
Srinivas


> +
>  		/*
>  		 * Return the hybrid scaling factor for P-cores and
> use the
>  		 * default core scaling for E-cores.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-05-10 14:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2 1/2] cpufreq: intel_pstate: Fix scaling for hybrid-capable CPUs not reporting hybrid Henry Tseng
2026-05-10 14:34   ` srinivas pandruvada
2026-05-08  6:30 ` [PATCH v2 2/2] cpufreq: intel_pstate: Use HYBRID_SCALING_FACTOR_ADL for Bartlett Lake Henry Tseng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox