All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herve Codina <herve.codina@bootlin.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Rob Herring <robh@kernel.org>,
	Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Ayush Singh <ayush@beagleboard.org>,
	Andi Shyti <andi.shyti@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-i2c@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree-spec@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH v3 1/1] schemas: i2c: Introduce I2C bus extensions
Date: Fri, 29 Aug 2025 12:52:38 +0200	[thread overview]
Message-ID: <20250829125238.4117947f@bootlin.com> (raw)
In-Reply-To: <aK2-we94b-x2fgW_@shikoro>

Hi Wolfram,

On Tue, 26 Aug 2025 16:03:45 +0200
Wolfram Sang <wsa+renesas@sang-engineering.com> wrote:

> Hi,
> 
> > > 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é

  reply	other threads:[~2025-08-29 10:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18  8:23 [PATCH v3 0/1] i2c: Introduce I2C bus extensions Herve Codina
2025-06-18  8:23 ` [PATCH v3 1/1] schemas: " Herve Codina
2025-08-01 18:09   ` Rob Herring
2025-08-08 16:07     ` Luca Ceresoli
2025-08-08 20:51       ` Rob Herring
2025-08-26 14:03         ` Wolfram Sang
2025-08-29 10:52           ` Herve Codina [this message]
2025-08-29 10:58             ` Wolfram Sang
2025-08-29 11:08               ` Herve Codina

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=20250829125238.4117947f@bootlin.com \
    --to=herve.codina@bootlin.com \
    --cc=andi.shyti@kernel.org \
    --cc=ayush@beagleboard.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree-spec@vger.kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=robh@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=wsa+renesas@sang-engineering.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.