[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aCVjxJB6dUzIAyPJ@hu-mdtipton-lv.qualcomm.com>
Date: Wed, 14 May 2025 20:47:16 -0700
From: Mike Tipton <quic_mdtipton@...cinc.com>
To: Sudeep Holla <sudeep.holla@....com>
CC: Cristian Marussi <cristian.marussi@....com>,
"Rafael J . Wysocki"
<rafael@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>, <arm-scmi@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <linux-pm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Peng Fan
<peng.fan@....nxp.com>,
Peng Fan <peng.fan@....com>
Subject: Re: [PATCH v3] cpufreq: scmi: Skip SCMI devices that aren't used by
the CPUs
On Wed, May 07, 2025 at 02:12:36PM +0100, Sudeep Holla wrote:
> On Wed, May 07, 2025 at 12:59:45PM +0100, Cristian Marussi wrote:
> > On Mon, Apr 28, 2025 at 07:47:28AM -0700, Mike Tipton wrote:
> > > +static bool scmi_dev_used_by_cpus(struct device *scmi_dev)
> > > +{
> > > + struct device_node *scmi_np = dev_of_node(scmi_dev);
> > > + struct device_node *np;
> > > + struct device *cpu_dev;
> > > + int cpu, idx;
> > > +
> > > + if (!scmi_np)
> > > + return false;
> > > +
> > > + for_each_possible_cpu(cpu) {
> > > + cpu_dev = get_cpu_device(cpu);
> > > + if (!cpu_dev)
> > > + continue;
> > > +
> > > + np = dev_of_node(cpu_dev);
> > > +
> > > + if (of_parse_phandle(np, "clocks", 0) == scmi_np)
> >
> > Shouldn't this, on Success, be released by an of_node_put() (or, BETTER,
> > by some OF-related cleanup.h magic...)
> >
>
> Good catch, I missed this.
>
> With the above issue fixed, you can add and post new version:
> Reviewed-by: Sudeep Holla <sudeep.holla@....com>
Thanks Cristian / Sudeep.
The cleanup.h __free() logic gets a bit cumbersome here, especially with
two struct *device_node to free in the same scope. And since there isn't
any complicated cleanup logic to unwind, then I'll just go with the
direct calls to of_node_put().
Also note we aren't calling of_node_put() in scmi_cpu_domain_id(),
either. I can fix that in a follow up patch.
I'll send v4 of this patch shortly.
Powered by blists - more mailing lists