public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Tipton <quic_mdtipton@quicinc.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Cristian Marussi <cristian.marussi@arm.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	<arm-scmi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Peng Fan <peng.fan@oss.nxp.com>, Peng Fan <peng.fan@nxp.com>
Subject: Re: [PATCH v3] cpufreq: scmi: Skip SCMI devices that aren't used by the CPUs
Date: Wed, 14 May 2025 20:47:16 -0700	[thread overview]
Message-ID: <aCVjxJB6dUzIAyPJ@hu-mdtipton-lv.qualcomm.com> (raw)
In-Reply-To: <20250507-analytic-practical-carp-5cddaf@sudeepholla>

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@arm.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.

  reply	other threads:[~2025-05-15  3:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-28 14:47 [PATCH v3] cpufreq: scmi: Skip SCMI devices that aren't used by the CPUs Mike Tipton
2025-05-06  1:25 ` Mike Tipton
2025-05-06 10:12   ` Sudeep Holla
2025-05-07 11:59 ` Cristian Marussi
2025-05-07 13:12   ` Sudeep Holla
2025-05-15  3:47     ` Mike Tipton [this message]
2025-05-07 13:18   ` Dan Carpenter
2025-05-07 13:27     ` Cristian Marussi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aCVjxJB6dUzIAyPJ@hu-mdtipton-lv.qualcomm.com \
    --to=quic_mdtipton@quicinc.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=peng.fan@nxp.com \
    --cc=peng.fan@oss.nxp.com \
    --cc=rafael@kernel.org \
    --cc=sudeep.holla@arm.com \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox