From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Brian Mak <makb@juniper.net>
Cc: Lee Jones <lee@kernel.org>,
Herve Codina <herve.codina@bootlin.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] mfd: core: Preserve OF node when ACPI handle is present
Date: Thu, 26 Feb 2026 09:39:22 +0200 [thread overview]
Message-ID: <aZ_4qqZCnpMKD_5q@smile.fi.intel.com> (raw)
In-Reply-To: <aZ_18m0gYBDEpSlt@smile.fi.intel.com>
On Thu, Feb 26, 2026 at 09:27:50AM +0200, Andy Shevchenko wrote:
> On Wed, Feb 25, 2026 at 03:21:05PM -0800, Brian Mak wrote:
> > Switch device_set_node back to ACPI_COMPANION_SET, so that the ACPI
>
> device_set_node()
> ACPI_COMPANION_SET() // but see below.
>
> > fwnode does not overwrite the of_node with NULL.
>
> > This allows MFD children with both OF nodes and ACPI handles to have OF
> > nodes again.
>
> Do you have a real use case? Can you elaborate more (platform, drivers
> being involved, et cetera)?
Even more thinking on this it looks like a violation of the levels of
the fwnodes. The current design was not expecting the ACPI *and* OF node
to appear in the list. They both are considered "primary" from the design
point of view.
In your case it seems like an OF node comes from likely DT overlay and
messes up this logic (although it can be considered 'secondary' semantically).
But the proposed patch is not a solution, it's a band-aid.
TL;DR: if there is a use case that worked before (please elaborate),
the patch as a quick fix looks okay, but with FIXME added and open coded logic:
/*
* ...description of use case...
*
* FIXME: The fwnode design doesn't allow proper sharing and stacking.
* Eventually this should become some device fwnode API call that will
* prepend the list of fwnodes (making ACPI one "primary" in that sense).
*/
if (adev)
set_primary_fwnode(&pdev->dev, acpi_fwnode_handle(adev));
else if (parent)
set_primary_fwnode(&pdev->dev, acpi_fwnode_handle(parent));
...
> > - device_set_node(&pdev->dev, acpi_fwnode_handle(adev ?: parent));
> > + ACPI_COMPANION_SET(&pdev->dev, adev ?: parent);
>
> As a quick fix this may be fine, but it needs a big FIXME explaining that this
> is actually a design limitation of fwnode that doesn't allow proper sharing
> and stacking.
>
> Bouncing back to ACPI_COMPANION_SET() also doesn't feel right as it hides
> the real thing here, and real thing is the primary/secondary fwnode types
> that we need to care of. Just call set_primary_fwnode() directly. It helps
> also to get rid of ACPI_COMPANION_SET() calls where it may be replaced with
> simple device_set_node().
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-02-26 7:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-25 23:21 [PATCH] mfd: core: Preserve OF node when ACPI handle is present Brian Mak
2026-02-26 7:27 ` Andy Shevchenko
2026-02-26 7:39 ` Andy Shevchenko [this message]
2026-02-26 19:40 ` Brian Mak
2026-02-26 20:22 ` Andy Shevchenko
2026-02-26 20:36 ` Brian Mak
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=aZ_4qqZCnpMKD_5q@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=herve.codina@bootlin.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=makb@juniper.net \
--cc=stable@vger.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