Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
	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 13:53:17 +0200	[thread overview]
Message-ID: <aR2vrdBwF_oJ9H7k@smile.fi.intel.com> (raw)
In-Reply-To: <aR2o2R30TbVOcqZe@opensource.cirrus.com>

On Wed, Nov 19, 2025 at 11:24:09AM +0000, Charles Keepax wrote:
> On Wed, Nov 19, 2025 at 12:06:57PM +0100, Bartosz Golaszewski wrote:
> > On Wed, Nov 19, 2025 at 11:58 AM Andy Shevchenko
> > <andriy.shevchenko@linux.intel.com> wrote:
> > > On Wed, Nov 19, 2025 at 11:50:09AM +0100, Bartosz Golaszewski wrote:
> > > > On Wed, Nov 19, 2025 at 11:47 AM Charles Keepax
> > > > <ckeepax@opensource.cirrus.com> wrote:
> > > > > On Wed, Nov 19, 2025 at 11:38:35AM +0100, Bartosz Golaszewski wrote:

...

> > > > > Cool, thanks for all your help here. Might take me a couple hours
> > > > > but I will get to the bottom of the EBUSY thing, and report back.
> > > >
> > > > Sure. Could you just post the stack trace down to where the EBUSY is
> > > > returned in drivers/base/swnode.c? I'd like to analyze the logic
> > > > myself too if that's not too much work for you.
> > >
> > > FWIW, there is also an interesting debug technique. Put in your driver where
> > > you get this error code something like this (after all #include directives):
> > >
> > > #undef EBUSY
> > > #define EBUSY __LINE__
> > >
> > > And then you get some error code which is line number in some C file. You can
> > > narrow down grepping of the EBUSY in the suspected files and get the one.
> > >
> > >         git grep -n -w EBUSY -- ...files of interest...
> > >
> > > Hope this saves some minutes for you.
> > 
> > Charles confirmed he gets it from device_add_software_node(). I want
> > to know how we're getting there and how we could end up already having
> > a software node.
> 
> Ok I think I see what is happening now, the swnode is created on
> the first cell (the pinctrl). Then it moves onto the second cell,
> but mfd_acpi_add_device() copies the firmware node into both
> devices, the device_set_node() call at the bottom. So it inherits
> the swnode node through that primary fwnode.

Okay, you got into fundamental problem of fwnode design it seems.

(below is the summary related to that, but it may be not related here)

If it's the case, there is no easy solution for it right now.

And going ahead, please, don't even try hacks like recreating a copy
of needed properties from the parent fwnode to get an independent child
fwnode.

The proper solution OTOH should be decoupling fwnode from struct device
and making there a list of fwnodes.

	struct fwnode_handle {
		struct list_head node;
		...
	}

	struct device {
		// asumming dropped of_node and fw_node
		struct list_head nodes;
	}

This will require at first to make sure no code dereferencing fwnode
(and of_node) from struct device. With that enormous task done, the
rest is much easier to achieve as it will be just API's internals
refactoring.

With that done, we may stitch as many fwnodes as we want where the order in
the list will define match priority.

> I am guessing this code has perhaps been more heavily tested on
> device tree where it is more common to have nodes for each cell,
> whereas ACPI is far more likely to have a single firmware node for
> the whole device.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2025-11-19 11:53 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 [this message]
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
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=aR2vrdBwF_oJ9H7k@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.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