Linux Power Management development
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: Henry Tseng <henrytseng@qnap.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>
Subject: Re: [PATCH] cpufreq: intel_pstate: Use CPPC to get scaling factor for Bartlett Lake
Date: Thu, 07 May 2026 07:47:05 -0700	[thread overview]
Message-ID: <5ff02dfbafea7f5a9129853ae147e6de1cefb281.camel@linux.intel.com> (raw)
In-Reply-To: <20260507092554.2631883-1-henrytseng@qnap.com>

On Thu, 2026-05-07 at 17:25 +0800, Henry Tseng wrote:
> On Wed, 06 May 2026 05:15:49 -0700, Srinivas Pandruvada wrote:
> > This is a special embedded processor, so to reduce enabling effort
> > by 
> > in BIOS, why not just add
> > 
> > diff --git a/drivers/cpufreq/intel_pstate.c
> > b/drivers/cpufreq/intel_pstate.c
> > index ec4abe374573..763598ca13cd 100644
> > --- a/drivers/cpufreq/intel_pstate.c
> > +++ b/drivers/cpufreq/intel_pstate.c
> > @@ -3732,6 +3732,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),
> >         {}
> > 
> > CPPC scaling introduces rounding issues for some frequency. This
> > will
> > avoid introducing another CPU model list.
> 
> Thanks for the review, the static table is definitely simpler. I had
> referenced commit 9b18d536b124 and went with CPPC, but I take your
> point
> about the rounding issues.
> After adding INTEL_BARTLETTLAKE to intel_hybrid_scaling_factor[], I
> noticed hwp_get_cpu_scaling() still falls back to core_get_scaling()
> on
> 273PE, because hybrid_get_cpu_type() returns 0 (not
> INTEL_CPU_TYPE_CORE)
> on a non-hybrid CPU, so the table value doesn't get picked up. I
> added a
> check for X86_FEATURE_HYBRID_CPU there to let non-hybrid CPUs in the
> table
> use hybrid_scaling_factor.
> 

This situation is not new, refer to commit
0fcfc9e51990246a9813475716746ff5eb98c6aa
    cpufreq: intel_pstate: Fix scaling for hybrid-capable systems with
disabled E-cores

So it seems some regression as it should returned hybrid scaling
factor.
Don't have this system handy to test. hybrid_get_cpu_type() will return
0 when hybrid feature is not set.

With this commit
9b18d536b124357fee56d82b1462c02f78d219e5

adding if (!cpu_feature_enabled(X86_FEATURE_HYBRID_CPU)), will break
such configuration.

So I suggest to send two patches. The first one can have 
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -2273,6 +2273,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;
+

You can add Fixes tag for commit
9b18d536b124357fee56d82b1462c02f78d219e5.

The second patch with hybrid scaling factor for Bartlett Lake, which is
like RPL. 

Thanks,
Srinivas


> I also kept hwp_is_hybrid = 0 on 273PE to match the current mainline
> behavior on non-hybrid CPUs.
> 
> Draft below, based on v7.1-rc2 (7fd2df204f34), tested on Intel Core 9
> 273PE:
> 
> diff --git a/drivers/cpufreq/intel_pstate.c
> b/drivers/cpufreq/intel_pstate.c
> index 1292da53e5fc..b66455252745 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);
> @@ -2279,7 +2279,8 @@ static int hwp_get_cpu_scaling(int cpu)
>  		 * Return the hybrid scaling factor for P-cores and
> use the
>  		 * default core scaling for E-cores.
>  		 */
> -		if (hybrid_get_cpu_type(cpu) == INTEL_CPU_TYPE_CORE)
> +		if (hybrid_get_cpu_type(cpu) == INTEL_CPU_TYPE_CORE
> ||
> +		    !cpu_feature_enabled(X86_FEATURE_HYBRID_CPU))
>  			return hybrid_scaling_factor;
>  
>  		return core_get_scaling();
> @@ -3734,6 +3735,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),
>  	{}
> 
> Result on 273PE:
> 
>   intel_pstate: CPU0:  HWP_CAP highest = 70, scaling = 78741,
> cpuinfo.max = 5500000
>   intel_pstate: CPU12: HWP_CAP highest = 73, scaling = 78741,
> cpuinfo.max = 5700000
> 
> If this direction looks OK, I'll send a v2 with a proper commit
> message.
> 
> Thanks,
> Henry

  reply	other threads:[~2026-05-07 14:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06  9:51 [PATCH] cpufreq: intel_pstate: Use CPPC to get scaling factor for Bartlett Lake Henry Tseng
2026-05-06 12:15 ` srinivas pandruvada
2026-05-07  9:25   ` Henry Tseng
2026-05-07 14:47     ` srinivas pandruvada [this message]
2026-05-08  6:37       ` 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=5ff02dfbafea7f5a9129853ae147e6de1cefb281.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=henrytseng@qnap.com \
    --cc=kevinko@qnap.com \
    --cc=lenb@kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --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