[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aKMoyp5xw9xSj2v1@pluto>
Date: Mon, 18 Aug 2025 14:21:14 +0100
From: Cristian Marussi <cristian.marussi@....com>
To: Dhruva Gole <d-gole@...com>
Cc: Cristian Marussi <cristian.marussi@....com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
arm-scmi@...r.kernel.org, linux-pm@...r.kernel.org,
sudeep.holla@....com, james.quinlan@...adcom.com,
f.fainelli@...il.com, vincent.guittot@...aro.org,
quic_sibis@...cinc.com, dan.carpenter@...aro.org,
johan+linaro@...nel.org, rafael@...nel.org, viresh.kumar@...aro.org,
quic_mdtipton@...cinc.com,
Florian Fainelli <florian.fainelli@...adcom.com>
Subject: Re: [PATCH 2/2] [NOT_FOR_UPSTREAM] cpufreq: scmi: Add quirk to
disable checks in scmi_dev_used_by_cpus()
On Mon, Aug 18, 2025 at 11:50:44AM +0530, Dhruva Gole wrote:
> On Aug 15, 2025 at 11:27:36 +0100, Cristian Marussi wrote:
> > From: Florian Fainelli <florian.fainelli@...adcom.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@....com>
> > Fixes: 6c9bb8692272 ("cpufreq: scmi: Skip SCMI devices that aren't used by the CPUs")
> > Signed-off-by: Florian Fainelli <florian.fainelli@...adcom.com>
> > [Cristian: Moved quirk directly into scmi_dev_used_by_cpus]
> > Signed-off-by: Cristian Marussi <cristian.marussi@....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:
Yes I saw this too....but seemed harmless and anyway Quirks are really
very peculiar piece of code...
Thanks
Cristian
Powered by blists - more mailing lists