Thread (9 messages) 9 messages, 4 authors, 2025-08-29

Re: [PATCH v3 1/1] schemas: i2c: Introduce I2C bus extensions

From: Herve Codina <herve.codina@bootlin.com>
Date: 2025-08-29 10:53:02
Also in: linux-i2c, lkml

Hi Wolfram,

On Tue, 26 Aug 2025 16:03:45 +0200
Wolfram Sang [off-list ref] wrote:
Hi,
quoted
quoted
A different option is to only have the "i2c-parent" phandle in the
extension node and nothing else in DT (no bidirectional link, no
compatible string), without any full-tree searches.

On the implementation side, the connector driver when probing would
register the extension nodes at the I2C core, which would maintain a
list of extension nodes. This is important when the connector probes
first. Then when any adapter probes the core would iterate over the
list to check whether the newly-probed adapter is pointed to by one of
the registered bus extensions, and then start populating the devices on
the matching bus extension(s).

A lot of care would have to be put in the disconnection path and while
removing any bus extension from the global list, which could race with
the I2C core using the list itself. The drive core wouldn't do it for
us for free.  
I'll defer to Wolfram on I2C core implementation...  
One input already before we dive into the unconference. I don't want to
maintain the above solution, i.e. handling lists with sublte race issues
which could be (and should be IMO) handled by the driver core anyhow.
Wolfram, could it be ok if this list is not global but related to the
adapter the extension belongs to?

If the list is really a nogo, registering extensions cannot be done and
so with:
 1) "i2c-parent" phandle and the compatible string "i2c-bus-extension" in
    the extension node.
 2) No registering extensions capabilities available

the only solution I see is to parse the full DT in order to find extension
nodes when we need to register adapter children (adapter probe() step).

A matching extension node will be a node where:
 1) compatible = "i2c-bus-extension"
 2) "i2c-parent" phandle points to the expected adapter.

Wolfram, is it a solution you can accept?

Best regards,
Hervé
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help