Re: [PATCH v7 3/3] i2c: mux: Propagate software nodes to channel adapters
From: Andy Shevchenko
Date: Mon Aug 31 2026 - 03:27:46 EST
On Sun, Aug 30, 2026 at 06:55:51AM +0200, Peter Rosin wrote:
> Den Thu, Aug 27, 2026 at 09:11:31AM +0300, skrev Andy Shevchenko:
> > On Wed, Aug 26, 2026 at 08:29:47AM -0700, Ahmad Byagowi wrote:
> > > Yes, software-node handling is needed for the ptp_ocp use case.
> >
> > That driver is a mess. I'm surprised nobody told to the authors of
> > the respective changes to look at the auxiliary implementation.
> >
> > > ptp_ocp is a PCI driver. It creates its board-specific I2C topology at
> > > runtime with software nodes: the mux, its channel nodes, sensors, and LED
> > > controller. Firmware does not provide ACPI nodes for this topology.
> > >
> > > The existing acpi_preset_companion() path only associates a mux adapter
> > > with an existing ACPI child. It does not associate the adapter with one of
> > > these dynamically created software-node channel nodes. Without that
> > > association, i2c_get_adapter_by_fwnode() cannot find the channel adapter by
> > > the channel software node, so ptp_ocp cannot instantiate the downstream I2C
> > > devices on the correct channel.
> > >
> > > Does this address the concern, or would you prefer a different way to
> > > represent this dynamically created topology?
> >
> > Wouldn't it be possible to use some kind of DT overlay to have that?
>
> For me, the above is a bit unrelated to this patch series, which is
> about converting i2c-mux from of-only properties to device properties.
> That seems like a change that stands on its own.
>
> I probably wasn't clear enough with my original question, but what I
> wondered about was what regression risk that conversion might have
> for the ACPI case. Specifically, there might be ACPI properties that
> match what the code is now looking for. It seems unlikely that such
> properties are actually deployed, but I know next to nothing about
> ACPI...
>
> TL;DR
>
> My original question should have been: Is it safe to simply remove
> these lines from the patch:
> > + if (!is_of_node(dev_node) && !is_software_node(dev_node))
> > + return NULL;
> and let the code trawl all kinds of device properties?
Technically it's safe. Administratively, it might be some "creative" ACPI
firmware author (who presumably hasn't seen anything than OF in their life
before) may assume that it's fine to use OF approach (while ACPI has even
documented "binding" for I²C muxes). So my answer "yes and no" :-) It all
depends on the human factor. If we trust people enough to read documentation
and follow, we are fine without these lines.
> Sorry for the confusion...
NP, I'm glad to help with ACPI.
--
With Best Regards,
Andy Shevchenko