[PATCH 2/2] [NOT_FOR_UPSTREAM] cpufreq: scmi: Add quirk to disable checks in scmi_dev_used_by_cpus()
Dhruva Gole
d-gole at ti.com
Sun Aug 17 23:20:44 PDT 2025
On Aug 15, 2025 at 11:27:36 +0100, Cristian Marussi wrote:
> From: Florian Fainelli <florian.fainelli at broadcom.com>
>
> 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.
>
> Leverage the quirks framework recently introduce to match on the
> Broadcom SCMI vendor and in that case, disable the Device Tree
> properties checks being done by scmi_dev_used_by_cpus().
>
> Suggested-by: Cristian Marussi <cristian.marussi at arm.com>
> Fixes: 6c9bb8692272 ("cpufreq: scmi: Skip SCMI devices that aren't used by the CPUs")
> Signed-off-by: Florian Fainelli <florian.fainelli at broadcom.com>
> [Cristian: Moved quirk directly into scmi_dev_used_by_cpus]
> Signed-off-by: Cristian Marussi <cristian.marussi at arm.com>
>
> ----
> @Florian: I reworked this minimally to avoid the global as I was mentioning.
> No change around the version match either...so the NOT_FOR_UPSTREAM tag.
> (also the if (true) i smaybe a bit idiotic...)
> Please check if it is fine and modify as you see fit.
> ---
> drivers/cpufreq/scmi-cpufreq.c | 9 +++++++++
> drivers/firmware/arm_scmi/quirks.c | 2 ++
> include/linux/scmi_quirks.h | 1 +
> 3 files changed, 12 insertions(+)
>
> diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c
> index ef078426bfd5..9b7cbc4e87d9 100644
> --- a/drivers/cpufreq/scmi-cpufreq.c
> +++ b/drivers/cpufreq/scmi-cpufreq.c
> @@ -19,6 +19,7 @@
> #include <linux/pm_qos.h>
> #include <linux/slab.h>
> #include <linux/scmi_protocol.h>
> +#include <linux/scmi_quirks.h>
> #include <linux/types.h>
> #include <linux/units.h>
>
> @@ -393,6 +394,12 @@ static struct cpufreq_driver scmi_cpufreq_driver = {
> .set_boost = cpufreq_boost_set_sw,
> };
>
> +#define QUIRK_SCMI_CPUFREQ_CHECK_DT_PROPS \
> + ({ \
> + if (true) \
> + return true; \
> + })
> +
Probably another checkpatch warning to fix:
8<--------------------------------------------------------------------
WARNING: Macros with flow control statements should be avoided
#50: FILE: drivers/cpufreq/scmi-cpufreq.c:397:
+#define QUIRK_SCMI_CPUFREQ_CHECK_DT_PROPS \
+ ({ \
+ if (true) \
+ return true; \
+ })
total: 0 errors, 1 warnings, 0 checks, 47 lines checked
-------------------------------------------------------------------->8
--
Best regards,
Dhruva Gole
Texas Instruments Incorporated
More information about the linux-arm-kernel
mailing list