From: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com>
To: Sudeep Holla <sudeep.holla@kernel.org>
Cc: arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
kernel-team@meta.com,
"Cristian Marussi" <cristian.marussi@arm.com>,
"Breno Leitao" <leitao@debian.org>,
"Andy Shevchenko" <andriy.shevchenko@linux.intel.com>,
"Daniel Scally" <djrscally@gmail.com>,
"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
"Sakari Ailus" <sakari.ailus@linux.intel.com>,
"Bartosz Golaszewski" <brgl@kernel.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"“Rafael J. Wysocki”" <rafael@kernel.org>,
"Danilo Krummrich" <dakr@kernel.org>
Subject: Re: [PATCH v3 1/9] firmware: arm_scmi: Set fwnode for the generated SCMI platform device
Date: Wed, 2 Sep 2026 16:26:42 -0700 [thread overview]
Message-ID: <20260902162642.000008d9@oss.qualcomm.com> (raw)
In-Reply-To: <20260902-tireless-steadfast-mongoose-cccac7@sudeepholla>
On Wed, 2 Sep 2026 08:51:10 +0100
Sudeep Holla <sudeep.holla@kernel.org> wrote:
> On Mon, Aug 24, 2026 at 09:51:33AM -0700, Jonathan Cameron wrote:
> > On Thu, 13 Aug 2026 12:32:56 +0100
> > Sudeep Holla <sudeep.holla@kernel.org> wrote:
> >
> > > Add a call to device_set_node() in the SCMI probe helper to associate
> > > generated SCMI platform device with the firmware node of its supplier
> > > transport device.
> > >
> > > This complements device_set_of_node_from_dev() and ensures that
> > > firmware node information is propagated correctly for both Device Tree
> > > and non-DT (e.g. ACPI) based systems.
> >
> > Hi Sudeep,
> >
>
> Hi Jonathan,
>
> Thanks for all the reviews. I was away for a while and started to look at
> addressing these now.
>
> > When you say 'complement' I'd like to see a little more. The guts
> > of both calls includes setting dev->ofnode() adn the extra bit
> > in device_set_of_node_from_dev() is about ensuring we drop existing
> > node reference (there isn't one) and increment the reference for what
> > is the parent of_node.
> >
>
> Yes I agree. At the time, when I hacked this up, I was supposed to take
> a look at it again which I never did.
>
> > I may be wrong, but I think that is unnecessary and if I'm wrong I'd
> > like to see more info here on why it is needed.
> >
>
> No your concerns are valid. For reference-counted non-OF fwnodes like ACPI or
> software node, platform_device_release() drops the fwnode reference,
> but device_set_node() does not acquire one.
>
> > Also, if this is commonly needed why doesn't device_set_node() include
> > that dance?
> >
>
> I think there are new helpers added recently in the tree, thinking of using
> then. See below.
>
> > Unless I fumbled the command, a grep suggests there are no instances
> > in tree of these both being called near each other.
> >
>
> I did that too before adding but somehow kept it for future investigation.
>
>
> > Jonathan
> >
> > >
> > > Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
> > > ---
> > > drivers/firmware/arm_scmi/common.h | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h
> > > index fe8c22cfb9f7..cc7d11c3c1f3 100644
> > > --- a/drivers/firmware/arm_scmi/common.h
> > > +++ b/drivers/firmware/arm_scmi/common.h
> > > @@ -650,6 +650,7 @@ static int __tag##_probe(struct platform_device *pdev) \
> > > } \
> > > \
> > > device_set_of_node_from_dev(&spdev->dev, dev); \
> > > + device_set_node(&spdev->dev, dev_fwnode(dev)); \
>
> How about something like this instead of above 2 lines:
>
> if (is_of_node(dev_fwnode(dev)))
> platform_device_set_of_node_from_dev(spdev, dev);
> else
> platform_device_set_fwnode(spdev, dev_fwnode(dev));
>
To me, if the reference counting is useful (and I'm a bit doubtful about that)
platform_device_set_fwnode() should be doing it. +CC those who might have
more insight on this.
Jonathan
next prev parent reply other threads:[~2026-09-02 23:27 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 11:32 [PATCH v3 0/9] firmware: arm_scmi: Refactoring and enablement of ACPI PCC transport Sudeep Holla
2026-08-13 11:32 ` [PATCH v3 1/9] firmware: arm_scmi: Set fwnode for the generated SCMI platform device Sudeep Holla
2026-08-24 16:51 ` Jonathan Cameron
2026-09-02 7:51 ` Sudeep Holla
2026-09-02 23:26 ` Jonathan Cameron [this message]
2026-09-03 9:16 ` Bartosz Golaszewski
2026-08-13 11:32 ` [PATCH v3 2/9] firmware: arm_scmi: Extend transport driver macro to support ACPI Sudeep Holla
2026-08-24 17:04 ` Jonathan Cameron
2026-09-02 7:53 ` Sudeep Holla
2026-08-13 11:32 ` [PATCH v3 3/9] firmware: arm_scmi: Convert OF-only paths to generic fwnode in SCMI core Sudeep Holla
2026-08-24 17:39 ` Jonathan Cameron
2026-09-02 13:39 ` Sudeep Holla
2026-09-02 23:29 ` Jonathan Cameron
2026-09-03 6:36 ` Sudeep Holla
2026-08-13 11:32 ` [PATCH v3 4/9] firmware: arm_scmi: Fall back to ACPI HID when "compatible" is absent Sudeep Holla
2026-08-24 17:43 ` Jonathan Cameron
2026-09-02 8:03 ` Sudeep Holla
2026-09-02 8:09 ` Sudeep Holla
2026-08-13 11:33 ` [PATCH v3 5/9] firmware: arm_scmi: Pass protocol ID to chan_available() transport callback Sudeep Holla
2026-08-24 17:45 ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 6/9] firmware: arm_scmi: Refactor protocol device creation logic Sudeep Holla
2026-08-24 17:49 ` Jonathan Cameron
2026-09-02 13:52 ` Sudeep Holla
2026-08-13 11:33 ` [PATCH v3 7/9] firmware: arm_scmi: Add ACPI PCC transport Sudeep Holla
2026-08-24 20:17 ` Jonathan Cameron
2026-09-03 13:43 ` Sudeep Holla
2026-08-13 11:33 ` [PATCH v3 8/9] firmware: arm_scmi: Initialise known ACPI protocol devices and channels Sudeep Holla
2026-08-24 20:21 ` Jonathan Cameron
2026-08-13 11:33 ` [PATCH v3 9/9] firmware: arm_scmi: Validate PCC shared memory signature Sudeep Holla
2026-08-24 20:24 ` Jonathan Cameron
2026-09-02 8:25 ` Sudeep Holla
2026-09-02 23:31 ` Jonathan Cameron
2026-09-03 6:39 ` Sudeep Holla
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=20260902162642.000008d9@oss.qualcomm.com \
--to=jonathan.cameron@oss.qualcomm.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arm-scmi@vger.kernel.org \
--cc=brgl@kernel.org \
--cc=cristian.marussi@arm.com \
--cc=dakr@kernel.org \
--cc=djrscally@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=kernel-team@meta.com \
--cc=leitao@debian.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sudeep.holla@kernel.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