* [PATCH v2] cpufreq: scmi: Account for malformed DT in scmi_dev_used_by_cpus()
@ 2025-08-15 20:57 Florian Fainelli
2025-08-18 6:36 ` Viresh Kumar
2025-08-18 10:21 ` Sudeep Holla
0 siblings, 2 replies; 3+ messages in thread
From: Florian Fainelli @ 2025-08-15 20:57 UTC (permalink / raw)
To: linux-kernel
Cc: james.quinlan, Florian Fainelli, Sudeep Holla, Cristian Marussi,
Rafael J. Wysocki, Viresh Kumar, Mike Tipton, Peng Fan, arm-scmi,
linux-arm-kernel, linux-pm
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@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)
+ * 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.
+ */
+ if (of_machine_is_compatible("brcm,brcmstb"))
+ return true;
+
return false;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] cpufreq: scmi: Account for malformed DT in scmi_dev_used_by_cpus()
2025-08-15 20:57 [PATCH v2] cpufreq: scmi: Account for malformed DT in scmi_dev_used_by_cpus() Florian Fainelli
@ 2025-08-18 6:36 ` Viresh Kumar
2025-08-18 10:21 ` Sudeep Holla
1 sibling, 0 replies; 3+ messages in thread
From: Viresh Kumar @ 2025-08-18 6:36 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-kernel, james.quinlan, Sudeep Holla, Cristian Marussi,
Rafael J. Wysocki, Mike Tipton, Peng Fan, arm-scmi,
linux-arm-kernel, linux-pm
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@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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] cpufreq: scmi: Account for malformed DT in scmi_dev_used_by_cpus()
2025-08-15 20:57 [PATCH v2] cpufreq: scmi: Account for malformed DT in scmi_dev_used_by_cpus() Florian Fainelli
2025-08-18 6:36 ` Viresh Kumar
@ 2025-08-18 10:21 ` Sudeep Holla
1 sibling, 0 replies; 3+ messages in thread
From: Sudeep Holla @ 2025-08-18 10:21 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-kernel, james.quinlan, Sudeep Holla, Cristian Marussi,
Rafael J. Wysocki, Viresh Kumar, Mike Tipton, Peng Fan, arm-scmi,
linux-arm-kernel, linux-pm
On Fri, Aug 15, 2025 at 01:57:14PM -0700, 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.
>
With the multi-line comment fixed as suggested by Viresh.
Reviewed-by: Sudeep Holla <sudeep.holla@arm.com>
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-18 10:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-15 20:57 [PATCH v2] cpufreq: scmi: Account for malformed DT in scmi_dev_used_by_cpus() Florian Fainelli
2025-08-18 6:36 ` Viresh Kumar
2025-08-18 10:21 ` Sudeep Holla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).