[PATCH v2] cpufreq: scmi: Account for malformed DT in scmi_dev_used_by_cpus()

Viresh Kumar viresh.kumar at linaro.org
Sun Aug 17 23:36:44 PDT 2025


On 15-08-25, 13:57, Florian Fainelli wrote:
> Broadcom STB platforms were early adopters of the SCMI framework and as
> a result, not all deployed systems have a Device Tree entry where SCMI
> protocol 0x13 (PERFORMANCE) is declared as a clock provider, nor are the
> CPU Device Tree node(s) referencing protocol 0x13 as their clock
> provider.
> 
> For those platforms, we allow the checks done by scmi_dev_used_by_cpus()
> to continue, and in the event of not having done an early return, we key
> off the documented compatible string and give them a pass to continue to
> use scmi-cpufreq.
> 
> Fixes: 6c9bb8692272 ("cpufreq: scmi: Skip SCMI devices that aren't used by the CPUs")
> Signed-off-by: Florian Fainelli <florian.fainelli at broadcom.com>
> ---
> Changes in v2:
> 
> - do not leverage the SCMI quirks framework which in spirit is for
>   dealing with SCMI firmware implementations, this right here,
>   specifically pertains to an older Device Tree. This also makes it
>   easier to backport that change into stable trees where the commit in
>   the Fixes tag is already present. There is no dependency upon the
>   presence of the SCMI quirks framework
> 
>  drivers/cpufreq/scmi-cpufreq.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
> index ef078426bfd5..9df4d968fdac 100644
> --- a/drivers/cpufreq/scmi-cpufreq.c
> +++ b/drivers/cpufreq/scmi-cpufreq.c
> @@ -15,6 +15,7 @@
>  #include <linux/energy_model.h>
>  #include <linux/export.h>
>  #include <linux/module.h>
> +#include <linux/of.h>
>  #include <linux/pm_opp.h>
>  #include <linux/pm_qos.h>
>  #include <linux/slab.h>
> @@ -424,6 +425,14 @@ static bool scmi_dev_used_by_cpus(struct device *scmi_dev)
>  			return true;
>  	}
>  
> +	/* Older Broadcom STB chips had a "clocks" property for CPU node(s)

Incorrect multi-line comment format.

> +	 * that did not match the SCMI performance protocol node, if we got
> +	 * there, it means we had such an older Device Tree, therefore return
> +	 * true to preserve backwards compatibility.
> +	 */

-- 
viresh



More information about the linux-arm-kernel mailing list