From: sashiko-bot@kernel.org
To: "Lakshay Piplani" <lakshay.piplani@nxp.com>
Cc: devicetree@vger.kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
robh@kernel.org, Frank.Li@kernel.org, conor+dt@kernel.org,
linux-i3c@lists.infradead.org
Subject: Re: [PATCH v15 1/8] i3c: master: Add APIs for I3C hub support
Date: Mon, 17 Aug 2026 10:50:58 +0000 [thread overview]
Message-ID: <20260817105058.71ADB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817103844.2142802-2-lakshay.piplani@nxp.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Medium] The commit message claims to add helpers for attaching and detaching I3C devices, but the implementation is completely missing.
Pre-existing issues:
- [High] Accidental removal of ID 0 from `i3c_bus_idr` when `i3c_bus_init()` fails.
--
--- Patch [1]: [PATCH v15 1/8] i3c: master: Add APIs for I3C hub support ---
commit 14f349144e98c1c3eedcaa4123a53bf24704569f
Author: Aman Kumar Pandey <aman.kumarpandey@nxp.com>
i3c: master: Add APIs for I3C hub support
This commit adds helpers to prepare for I3C hub support. It exposes
address slot management and CCC command interfaces, and allows registering
virtual masters with an explicit firmware node.
> Add helpers for attaching and detaching I3C devices and CCC helpers
> to check CCC support and send CCC commands, address slot helpers to
> query and update I3C bus address slot state, registering virtual
[Severity: Medium]
The commit message claims to add helpers for attaching and detaching I3C
devices, but the implementation is completely missing from the patch.
The changelog indicates that the attach and detach helpers were dropped in
v15. Should the commit message be updated to reflect this change?
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index f1be38a640ca1..03fb41f0786c5 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
[ ... ]
> @@ -3352,6 +3427,39 @@ int i3c_master_register(struct i3c_master_controller *master,
>
> return ret;
> }
> +EXPORT_SYMBOL_GPL(i3c_master_register_fwnode);
[Severity: High]
This isn't a bug introduced by this patch, but does the error handling in
i3c_master_register_fwnode() corrupt the global IDR state?
If i3c_bus_init() fails at idr_alloc() (e.g., due to duplicate alias in DT),
it returns an error while leaving i3cbus->id as 0:
drivers/i3c/master.c:i3c_bus_init() {
...
ret = idr_alloc(&i3c_bus_idr, i3cbus, start, end, GFP_KERNEL);
if (ret < 0)
return ret;
...
}
Taking the goto err_put_dev path then calls put_device(&master->dev), which
eventually triggers i3c_masterdev_release():
drivers/i3c/master.c:i3c_masterdev_release() {
...
i3c_bus_cleanup(bus);
...
}
This calls idr_remove(&i3c_bus_idr, i3cbus->id). Because i3cbus->id is still 0,
doesn't this accidentally remove the valid bus 0 from the IDR tree?
This could lead to duplicate sysfs names ('i3c-0') and crashes during
device_add() for a new bus.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260817103844.2142802-1-lakshay.piplani@nxp.com?part=1
WARNING: multiple messages have this Message-ID (diff)
From: sashiko-bot@kernel.org
To: "Lakshay Piplani" <lakshay.piplani@nxp.com>
Cc: devicetree@vger.kernel.org,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
robh@kernel.org, Frank.Li@kernel.org, conor+dt@kernel.org,
linux-i3c@lists.infradead.org
Subject: Re: [PATCH v15 1/8] i3c: master: Add APIs for I3C hub support
Date: Mon, 17 Aug 2026 10:50:58 +0000 [thread overview]
Message-ID: <20260817105058.71ADB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260817103844.2142802-2-lakshay.piplani@nxp.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Medium] The commit message claims to add helpers for attaching and detaching I3C devices, but the implementation is completely missing.
Pre-existing issues:
- [High] Accidental removal of ID 0 from `i3c_bus_idr` when `i3c_bus_init()` fails.
--
--- Patch [1]: [PATCH v15 1/8] i3c: master: Add APIs for I3C hub support ---
commit 14f349144e98c1c3eedcaa4123a53bf24704569f
Author: Aman Kumar Pandey <aman.kumarpandey@nxp.com>
i3c: master: Add APIs for I3C hub support
This commit adds helpers to prepare for I3C hub support. It exposes
address slot management and CCC command interfaces, and allows registering
virtual masters with an explicit firmware node.
> Add helpers for attaching and detaching I3C devices and CCC helpers
> to check CCC support and send CCC commands, address slot helpers to
> query and update I3C bus address slot state, registering virtual
[Severity: Medium]
The commit message claims to add helpers for attaching and detaching I3C
devices, but the implementation is completely missing from the patch.
The changelog indicates that the attach and detach helpers were dropped in
v15. Should the commit message be updated to reflect this change?
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index f1be38a640ca1..03fb41f0786c5 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
[ ... ]
> @@ -3352,6 +3427,39 @@ int i3c_master_register(struct i3c_master_controller *master,
>
> return ret;
> }
> +EXPORT_SYMBOL_GPL(i3c_master_register_fwnode);
[Severity: High]
This isn't a bug introduced by this patch, but does the error handling in
i3c_master_register_fwnode() corrupt the global IDR state?
If i3c_bus_init() fails at idr_alloc() (e.g., due to duplicate alias in DT),
it returns an error while leaving i3cbus->id as 0:
drivers/i3c/master.c:i3c_bus_init() {
...
ret = idr_alloc(&i3c_bus_idr, i3cbus, start, end, GFP_KERNEL);
if (ret < 0)
return ret;
...
}
Taking the goto err_put_dev path then calls put_device(&master->dev), which
eventually triggers i3c_masterdev_release():
drivers/i3c/master.c:i3c_masterdev_release() {
...
i3c_bus_cleanup(bus);
...
}
This calls idr_remove(&i3c_bus_idr, i3cbus->id). Because i3cbus->id is still 0,
doesn't this accidentally remove the valid bus 0 from the IDR tree?
This could lead to duplicate sysfs names ('i3c-0') and crashes during
device_add() for a new bus.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260817103844.2142802-1-lakshay.piplani@nxp.com?part=1
--
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c
next prev parent reply other threads:[~2026-08-17 10:50 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-17 10:38 [PATCH v15 0/8] Add support for NXP P3H2x4x I3C hub driver Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:38 ` [PATCH v15 1/8] i3c: master: Add APIs for I3C hub support Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:50 ` sashiko-bot [this message]
2026-08-17 10:50 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 2/8] i3c: master: Add controller-only device operation helpers Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:50 ` sashiko-bot
2026-08-17 10:50 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 3/8] dt-bindings: i3c: Add NXP P3H2x4x i3c-hub support Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:49 ` sashiko-bot
2026-08-17 10:49 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 4/8] mfd: p3h2x4x: Add driver for NXP P3H2x4x i3c hub and on-die regulator Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:52 ` sashiko-bot
2026-08-17 10:52 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 5/8] regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x i3c hub Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:51 ` sashiko-bot
2026-08-17 10:51 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 6/8] i3c: hub: Add support for the I3C interface in the I3C hub Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:53 ` sashiko-bot
2026-08-17 10:53 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 7/8] i3c: hub: p3h2x4x: Add support for NXP P3H2x4x I3C hub functionality Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 10:51 ` sashiko-bot
2026-08-17 10:51 ` sashiko-bot
2026-08-17 10:38 ` [PATCH v15 8/8] i3c: hub: p3h2x4x: Add SMBus slave mode support Lakshay Piplani
2026-08-17 10:38 ` Lakshay Piplani
2026-08-17 11:04 ` sashiko-bot
2026-08-17 11:04 ` sashiko-bot
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=20260817105058.71ADB1F000E9@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 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.