From: sashiko-bot@kernel.org
To: "Lakshay Piplani" <lakshay.piplani@nxp.com>
Cc: devicetree@vger.kernel.org, Frank.Li@kernel.org, robh@kernel.org,
conor+dt@kernel.org, linux-i3c@lists.infradead.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH v19 6/8] i3c: hub: Add support for the I3C interface in the I3C hub
Date: Wed, 16 Sep 2026 07:21:27 +0000 [thread overview]
Message-ID: <20260916072127.A5D741F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260916070728.1088801-7-lakshay.piplani@nxp.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] i3c: hub: dynamically discovered devices attach to wrong bus bypassing port
- [Medium] i3c: hub: cascaded hubs fail to propagate address reservations to root bus
--
commit 9fb8ad75cf771fba9c1b6bdfec7ca6cd1cb60041
Author: Lakshay Piplani <lakshay.piplani@nxp.com>
i3c: hub: Add support for the I3C interface in the I3C hub
This patch adds virtual I3C bus support for hubs by creating virtual
master controllers for downstream ports and forwarding bus operations
through the hub device. It also provides an interface used by hub
drivers to enable or disable downstream ports during bus transactions.
> diff --git a/drivers/i3c/hub.c b/drivers/i3c/hub.c
> new file mode 100644
> index 0000000000000..5390287680844
> --- /dev/null
> +++ b/drivers/i3c/hub.c
> @@ -0,0 +1,832 @@
[ ... ]
> +static int i3c_hub_do_daa(struct i3c_hub *hub,
> + struct i3c_master_controller *controller)
> +{
[ ... ]
> + /*
> + * Downstream devices reachable through hub target-port routes share the
> + * parent controller's I3C address space. The hub gates access to a
> + * target-port network, but it does not create an independent dynamic
> + * address domain per virtual bus.
> + *
> + * Run DAA on the parent controller so dynamic addresses remain unique
> + * across all downstream devices, even when they are behind different
> + * target ports.
> + *
> + * The current hub model shares the parent controller's dynamic-address
> + * domain and does not support independent per-port DAA domains, so a
> + * DAA result does not go stale behind a port toggle. Addresses reserved
> + * from the Device Tree are held for the lifetime of the parent bus and
> + * are never released on a port toggle, so enabling or disabling a port
> + * only gates reachability and never causes an address to be handed out
> + * twice.
> + */
> + ret = i3c_master_do_daa(parent);
[Severity: High]
When i3c_hub_do_daa() forwards DAA to the parent controller here, won't
the parent discover the downstream device and add it to its own
parent->bus.devs.i3c list instead of the virtual bus?
If a downstream device without a static address connects behind the hub
port, and the physical parent controller owns the device record, subsequent
I/O will use the parent's i3c_xfers() implementation. Does this permanently
bypass the virtual hub controller, meaning the i3c_hub_enable_port() routing
logic is never triggered for these devices and transfers will fail?
> + i3c_hub_disable_port(controller);
> + mutex_unlock(&hub->lock);
> +
> + return ret;
> +}
[ ... ]
> +int i3c_hub_reserve_parent_addrslots_from_dt(struct i3c_hub_controller *hubc,
> + struct device_node *node)
> +{
[ ... ]
> + i3c_bus_maintenance_lock(&parent->bus);
> + status = i3c_bus_get_addr_slot_status(&parent->bus,
> + assigned_addr);
> + if (status == I3C_ADDR_SLOT_FREE)
> + i3c_bus_set_addr_slot_status(&parent->bus,
> + assigned_addr,
> + I3C_ADDR_SLOT_I3C_DEV);
[Severity: Medium]
In a cascaded hub topology, won't this only update the addrslots bitmap
of the immediate parent->bus (which is the upstream hub's virtual bus)?
Since DAA is recursively forwarded to the root physical controller, that
root controller assigns dynamic addresses based on its own addrslots bitmap.
Does this mean the nested address reservations fail to reach the root bus,
potentially leading to dynamic address collisions if the root controller
assigns these reserved addresses to newly discovered devices?
> + i3c_bus_maintenance_unlock(&parent->bus);
> + }
> + return 0;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260916070728.1088801-1-lakshay.piplani@nxp.com?part=6
next prev parent reply other threads:[~2026-09-16 7:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 7:07 [PATCH v19 0/8] Add support for NXP P3H2x4x I3C hub driver Lakshay Piplani
2026-09-16 7:07 ` [PATCH v19 1/8] i3c: master: Add APIs for I3C hub support Lakshay Piplani
2026-09-16 7:07 ` [PATCH v19 2/8] i3c: master: Add controller-only device operation helpers Lakshay Piplani
2026-09-16 7:07 ` [PATCH v19 3/8] dt-bindings: i3c: Add NXP P3H2x4x i3c-hub support Lakshay Piplani
2026-09-16 7:15 ` sashiko-bot
2026-09-16 7:07 ` [PATCH v19 4/8] mfd: p3h2x4x: Add driver for NXP P3H2x4x i3c hub and on-die regulator Lakshay Piplani
2026-09-16 7:19 ` sashiko-bot
2026-09-16 7:07 ` [PATCH v19 5/8] regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub Lakshay Piplani
2026-09-16 7:17 ` sashiko-bot
2026-09-16 7:07 ` [PATCH v19 6/8] i3c: hub: Add support for the I3C interface in the I3C hub Lakshay Piplani
2026-09-16 7:21 ` sashiko-bot [this message]
2026-09-21 21:15 ` Alexandre Belloni
2026-09-16 7:07 ` [PATCH v19 7/8] i3c: hub: p3h2x4x: Add support for NXP P3H2x4x I3C hub functionality Lakshay Piplani
2026-09-16 7:22 ` sashiko-bot
2026-09-16 7:07 ` [PATCH v19 8/8] i3c: hub: p3h2x4x: Add SMBus slave mode support Lakshay Piplani
2026-09-16 7:25 ` sashiko-bot
2026-09-22 7:26 ` [PATCH v19 0/8] Add support for NXP P3H2x4x I3C hub driver Lee Jones
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=20260916072127.A5D741F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=alexandre.belloni@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=lakshay.piplani@nxp.com \
--cc=linux-i3c@lists.infradead.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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