[PATCH] firmware: arm_scmi: Don't mark OPPs as turbo without a sustained frequency

Dale Whinham posted 1 patch 3 days, 11 hours ago
drivers/firmware/arm_scmi/perf.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
[PATCH] firmware: arm_scmi: Don't mark OPPs as turbo without a sustained frequency
Posted by Dale Whinham 3 days, 11 hours ago
If the firmware reports a sustained frequency of 0, every OPP is marked
as turbo. With boost disabled, cpufreq then has no usable frequencies and
fails to create a policy for the domain.

The Surface Pro 11 (X1P64100) CPUCP firmware does this for the two
clusters that have a core fused off.

Treat 0 as "not provided" and don't mark any OPPs as turbo.

Fixes: a897575e79d7 ("firmware: arm_scmi: Add support for marking certain frequencies as turbo")
Cc: stable@vger.kernel.org
Tested-by: Haipeng Lin <jimmie.lin@gmail.com>
Signed-off-by: Dale Whinham <daleyo@gmail.com>
---
From decompiling the CPUCP firmware: it reports as sustained the first
LUT entry rated for exactly the cluster's fused core count, or 0 if
there is none. On X1P64100, clusters 1 and 2 have 3 cores but only
4-core LUT entries, so they get 0. X1E80100 reports non-zero values and
is unaffected.
---
 drivers/firmware/arm_scmi/perf.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 0116ffb2b279..d4394984a0f5 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -879,8 +879,13 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
 		else
 			freq = dom->opp[idx].indicative_freq * dom->mult_factor;
 
-		/* All OPPs above the sustained frequency are treated as turbo */
-		data.turbo = freq > dom->sustained_freq_khz * 1000UL;
+		/*
+		 * All OPPs above the sustained frequency are treated as turbo.
+		 * A sustained frequency of 0 means the firmware didn't provide
+		 * one, so don't mark anything as turbo in that case.
+		 */
+		data.turbo = dom->sustained_freq_khz &&
+			     freq > dom->sustained_freq_khz * 1000UL;
 
 		data.level = dom->opp[idx].perf;
 		data.freq = freq;

---
base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
change-id: 20261121-sp11-noturbo-becde22ce314

Best regards,
--  
Dale Whinham <daleyo@gmail.com>
Re: [PATCH] firmware: arm_scmi: Don't mark OPPs as turbo without a sustained frequency
Posted by Sudeep Holla 1 day, 2 hours ago
On Sat, Nov 21, 2026 at 12:56:02AM +0000, Dale Whinham wrote:
> If the firmware reports a sustained frequency of 0, every OPP is marked
> as turbo. With boost disabled, cpufreq then has no usable frequencies and
> fails to create a policy for the domain.
> 
> The Surface Pro 11 (X1P64100) CPUCP firmware does this for the two
> clusters that have a core fused off.
> 
> Treat 0 as "not provided" and don't mark any OPPs as turbo.
> 

Charlie had posted a fix for this a while ago but never got back to my
comments.[1]

> Fixes: a897575e79d7 ("firmware: arm_scmi: Add support for marking certain frequencies as turbo")
> Cc: stable@vger.kernel.org
> Tested-by: Haipeng Lin <jimmie.lin@gmail.com>
> Signed-off-by: Dale Whinham <daleyo@gmail.com>
> ---
> From decompiling the CPUCP firmware: it reports as sustained the first
> LUT entry rated for exactly the cluster's fused core count, or 0 if
> there is none. On X1P64100, clusters 1 and 2 have 3 cores but only
> 4-core LUT entries, so they get 0. X1E80100 reports non-zero values and
> is unaffected.
> ---
>  drivers/firmware/arm_scmi/perf.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
> index 0116ffb2b279..d4394984a0f5 100644
> --- a/drivers/firmware/arm_scmi/perf.c
> +++ b/drivers/firmware/arm_scmi/perf.c
> @@ -879,8 +879,13 @@ static int scmi_dvfs_device_opps_add(const struct scmi_protocol_handle *ph,
>  		else
>  			freq = dom->opp[idx].indicative_freq * dom->mult_factor;
>  
> -		/* All OPPs above the sustained frequency are treated as turbo */
> -		data.turbo = freq > dom->sustained_freq_khz * 1000UL;
> +		/*
> +		 * All OPPs above the sustained frequency are treated as turbo.
> +		 * A sustained frequency of 0 means the firmware didn't provide
> +		 * one, so don't mark anything as turbo in that case.
> +		 */
> +		data.turbo = dom->sustained_freq_khz &&
> +			     freq > dom->sustained_freq_khz * 1000UL;

I worked out something very similar as a solution. Anyways does it work
if we also add the check for non-zero dom->sustained_perf_level ?

No need to repost if you agree, I will fix it up while applying ?

-- 
Regards,
Sudeep

[1] https://lore.kernel.org/arm-scmi/20260923152245.44624-1-charlie@akao.au