From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Meagan Lloyd <meaganlloyd@linux.microsoft.com>
Cc: Sam Agazaryan <samagazaryan@google.com>,
linux-i3c@lists.infradead.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Frank Li <Frank.Li@nxp.com>, Arnd Bergmann <arnd@arndb.de>,
Vitor Soares <vitor.soares@toradex.com>,
Oleksandr Shulzhenko <oleksandr.shulzhenko.viktorovych@intel.com>,
linux-kernel@vger.kernel.org, tgopinath@linux.microsoft.com,
boris.brezillon@collabora.com
Subject: Re: [PATCH v4 3/3] i3c: add i3cdev module to expose i3c dev in /dev
Date: Fri, 18 Sep 2026 21:21:43 +0100 [thread overview]
Message-ID: <2026091834-bats-palpitate-5614@gregkh> (raw)
In-Reply-To: <20260918-bc8077794cfb7321acf66420@linux.microsoft.com>
On Fri, Sep 18, 2026 at 11:59:02AM -0700, Meagan Lloyd wrote:
> On Thu, Sep 17, 2026 at 03:27:38PM -0700, Meagan Lloyd wrote:
> > On Fri, Sep 11, 2026 at 05:12:40PM -0700, Sam Agazaryan wrote:
> > > Hey Meagan,
> > >
> > > Thanks for sharing your patch series.
> > >
> > > The reason we have the bus notifier system here is
> > > 1. Dynamic module loading is handled automatically: if i3cdev is built-in and
> > > a specialized driver module loads later, the bus notifier receives
> > > BUS_NOTIFY_BIND_DRIVER and immediately calls i3cdev_detach().
> >
> > I think the bus notifier approach has the potential to hit some race
> > conditions with other drivers.
> >
> > For example, drivers/base/dd.c, really_probe is the only spot in the
> > source code that BUS_NOTIFY_BIND_DRIVER event occurs:
> > really_probe
> > driver_sysfs_add <- where BUS_NOTIFY_BIND_DRIVER occurs
> > call_driver_probe
> >
> > If a specialized driver's probe sets dev->driver_data, and i3cdev_detach
> > gets to run afterwards, wouldn't it overwrite driver_data with
> > NULL and clobber the driver_data?
> >
> > Similarly, a driver setting dev->driver_data could cause you to lose
> > your i3cdev_data pointer - which you need for teardown in i3cdev_detach.
> >
> > The use of the dev->driver_data field when i3cdev isn't a registered
> > device driver was one of the feedback points flagged in v3 (2020).
>
> I made an assumption in my previous analysis. I assumed that the
> notification would be dispatched in its own thread. Digging more,
> bus_notify just invokes all the registered .notifier_call callbacks, so
> i3cdev_detach would be guaranteed to run before call_driver_probe.
>
> Please disregard my previous comment and apologies for the confusion.
>
> >
> > > 2. No cross-subsystem changes needed. The bus notifier avoids touching other
> > > subsystems entirely.
> >
> > That's true and certainly a plus!
> >
> > > 3. Boot-time recovery flows: For OCP Secure Firmware Recovery
> > > devices come up unbound and need /dev/bus/i3c/<device> available
> > > immediately without requiring udev rules or sysfs writes first.
> > >
> >
> > Why can't you use udev rules?
> >
> > You can use them to automatically set driver_override & bind to i3cdev.
> > Once the rules are in-place, the setup of character device files in
> > /dev/bus/i3c/<device> will be immediate and automatic on-boot and for any
> > devices that join later.
> >
> > You can also do it for all I3C devices if that's what you want.
> >
>
> FWIW, your solution will also work for me. I'm looking to query SKU
> information over I3C and then configure I3C Hubs according to the
> hardware path.
Note that manually using bind will taint the kernel in the near future,
so NEVER rely on that to do anything that you rely on (i.e. normal
operations.) The bind/unbind and driver_override stuff is there for
debugging stuff, not for normal hardware support. Do it properly and
don't attempt to abuse that interface please.
thanks,
gre gk-h
next prev parent reply other threads:[~2026-09-18 20:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-06 20:27 [PATCH v4 0/3] i3c: Introduce i3c device userspace interface Sam Agazaryan
2026-09-06 20:27 ` [PATCH v4 1/3] i3c: master: export i3c_masterdev_type Sam Agazaryan
2026-09-06 20:27 ` [PATCH v4 2/3] i3c: master: add i3c_for_each_dev helper Sam Agazaryan
2026-09-06 20:27 ` [PATCH v4 3/3] i3c: add i3cdev module to expose i3c dev in /dev Sam Agazaryan
2026-09-07 14:40 ` Greg Kroah-Hartman
2026-09-09 6:13 ` Sam Agazaryan
2026-09-09 21:51 ` Frank Li
2026-09-11 3:44 ` Sam Agazaryan
2026-09-11 15:10 ` Frank Li
2026-09-11 23:57 ` Sam Agazaryan
2026-09-11 19:03 ` Adrian Hunter
2026-09-14 23:46 ` Sam Agazaryan
2026-09-15 9:49 ` Adrian Hunter
2026-09-15 21:26 ` Sam Agazaryan
2026-09-11 22:05 ` Meagan Lloyd
2026-09-12 0:12 ` Sam Agazaryan
2026-09-17 22:27 ` Meagan Lloyd
2026-09-18 18:59 ` Meagan Lloyd
2026-09-18 20:21 ` Greg Kroah-Hartman [this message]
2026-09-18 22:47 ` Sam Agazaryan
2026-09-08 11:48 ` [PATCH v4 0/3] i3c: Introduce i3c device userspace interface Wolfram Sang
2026-09-12 11:12 ` Wolfram Sang
2026-09-14 20:58 ` Sam Agazaryan
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=2026091834-bats-palpitate-5614@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=Frank.Li@nxp.com \
--cc=alexandre.belloni@bootlin.com \
--cc=arnd@arndb.de \
--cc=boris.brezillon@collabora.com \
--cc=linux-i3c@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=meaganlloyd@linux.microsoft.com \
--cc=oleksandr.shulzhenko.viktorovych@intel.com \
--cc=samagazaryan@google.com \
--cc=tgopinath@linux.microsoft.com \
--cc=vitor.soares@toradex.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
all inboxes | Powered by JetHome®