From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Charles Keepax <ckeepax@opensource.cirrus.com>,
David Rhodes <david.rhodes@cirrus.com>,
Richard Fitzgerald <rf@opensource.cirrus.com>,
Lee Jones <lee@kernel.org>, Mark Brown <broonie@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Linus Walleij <linus.walleij@linaro.org>,
Maciej Strozek <mstrozek@opensource.cirrus.com>,
Andy Shevchenko <andy@kernel.org>,
linux-sound@vger.kernel.org, patches@opensource.cirrus.com,
linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: Re: [PATCH RFT/RFC] mfd: cs42l43: setup true links with software nodes
Date: Wed, 19 Nov 2025 22:38:30 +0200 [thread overview]
Message-ID: <aR4qxiR7pzrPdaUz@smile.fi.intel.com> (raw)
In-Reply-To: <CAMRc=MdbgeJOMoHDm_z04ko1pdKed06GP4=M+VsPaD3YOEvs6Q@mail.gmail.com>
On Wed, Nov 19, 2025 at 03:30:46PM +0100, Bartosz Golaszewski wrote:
> On Wed, Nov 19, 2025 at 3:24 PM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
> > > > My idea was to mark the fwnode with __private and fix the (ab)users,
> > > > should not be so many. Can somebody mock up a coccinelle script to
> > > > find all dereferences of fwnode from struct device?
> > >
> > > I think you're underestimating the level of complexity. What about the
> > > concept of dev_fwnode()? It literally makes no sense if we switch to a
> > > list of fwnodes.
> >
> > Why not? It will return the pointer to the primary node. You can look
> > for example how the list of the DMA descriptors is done in
> > drivers/dma/dw/core.c. Not the best solution, but gives you an idea of
> > how it may look.
>
> What even is a primary node though? You can have auxiliary devices
> without an ACPI or OF node.
The one which gives the main set of the properties for the device.
The devices that don't have it, simply have a list of fwnodes empty.
> Only with software nodes. Which one is the
> primary? The first one we add?
Yes. The problem here might be if we add the SW node before the actual FW node
appear (it can be if we created some devices before the actual FW based
enumeration happens. It would probably need to have some kind of weight
(or priority value) and list should be sorted based on that number.
> > > For it to make sense we'd have to have a kind of "dynamic" firmware
> > > node attached to a device which we'd fill with an aggregation of all
> > > properties from firmware nodes in the list.
> >
> > "Dynamic" is just a node in the list. The only potential problem here
> > is prioritisation. Should we add to the head, tail or insert? But
> > converting current approach will be straightforward.
>
> What I have in my mind is not another firmware node in the list in
> struct device but rather a new firmware node implementation, that
> would be assigned to the device via a dedicated pointer and would be
> filled with a logical OR of properties from other firmware nodes added
> to the list.
Oh no, this won't work in corner cases. What if we actually need to "fix"
an existing primary node (there were discussions long time ago about inverting
primary/secondary in some corner cases, but it didn't appear so far as
it most likely will give tons of issues in the _current_ design)?
> Then dev_fwnode() would return this rather than any one
> of the firmware nodes from the list. Think of it as the "master
> fwnode" of a struct device.
fwnode should not be in any relations to the device, I mean when we do fwnodes,
we should not assume that it's backing the device. In the idea you shared it
won't be possible ("dedicated pointer") in mine it is (just a list of something
that may belong to the device, or to another object, doesn't matter).
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-11-19 20:38 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-19 9:10 [PATCH RFT/RFC] mfd: cs42l43: setup true links with software nodes Bartosz Golaszewski
2025-11-19 9:30 ` Charles Keepax
2025-11-19 9:35 ` Andy Shevchenko
2025-11-19 9:40 ` Bartosz Golaszewski
2025-11-19 9:57 ` Charles Keepax
2025-11-19 10:20 ` Bartosz Golaszewski
2025-11-19 10:38 ` Bartosz Golaszewski
2025-11-19 10:47 ` Charles Keepax
2025-11-19 10:50 ` Bartosz Golaszewski
2025-11-19 10:58 ` Andy Shevchenko
2025-11-19 11:06 ` Bartosz Golaszewski
2025-11-19 11:24 ` Charles Keepax
2025-11-19 11:53 ` Andy Shevchenko
2025-11-19 12:08 ` Bartosz Golaszewski
2025-11-19 11:58 ` Bartosz Golaszewski
2025-11-19 12:53 ` Charles Keepax
2025-11-19 13:07 ` Bartosz Golaszewski
2025-11-19 13:26 ` Charles Keepax
2025-11-19 13:34 ` Bartosz Golaszewski
2025-11-19 14:11 ` Andy Shevchenko
2025-11-19 14:15 ` Bartosz Golaszewski
2025-11-19 14:23 ` Andy Shevchenko
2025-11-19 14:30 ` Bartosz Golaszewski
2025-11-19 20:38 ` Andy Shevchenko [this message]
2025-11-20 9:12 ` Bartosz Golaszewski
2025-11-20 9:56 ` Andy Shevchenko
2025-11-20 12:33 ` Bartosz Golaszewski
2025-11-19 14:09 ` Bartosz Golaszewski
2025-11-19 14:45 ` Bartosz Golaszewski
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=aR4qxiR7pzrPdaUz@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=david.rhodes@cirrus.com \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=mstrozek@opensource.cirrus.com \
--cc=p.zabel@pengutronix.de \
--cc=patches@opensource.cirrus.com \
--cc=rf@opensource.cirrus.com \
/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