From: sashiko-bot@kernel.org
To: "Shenwei Wang" <shenwei.wang@oss.nxp.com>
Cc: imx@lists.linux.dev, robh@kernel.org, conor+dt@kernel.org,
devicetree@vger.kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH v16 3/5] rpmsg: core: match rpmsg device IDs by prefix
Date: Wed, 23 Sep 2026 18:59:31 +0000 [thread overview]
Message-ID: <20260923185931.C52C01F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260923184255.299034-4-shenwei.wang@oss.nxp.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] rpmsg: core: global prefix matching causes driver binding collisions
- [High] rpmsg: core: broken module autoloading for dynamically suffixed devices
--
commit b3b593160f090b0f9bdaa3003ed014a224f40238
Author: Shenwei Wang <shenwei.wang@nxp.com>
rpmsg: core: match rpmsg device IDs by prefix
The current rpmsg_id_match() implementation requires an exact string match
between the driver id_table entry and the rpmsg device name. This commit
updates the matching logic to compare only the length of the id->name string,
allowing id_table entries to act as prefixes for matching devices.
> diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
> index 04bfcc75f05b4..97a4db52b0401 100644
> --- a/drivers/rpmsg/rpmsg_core.c
> +++ b/drivers/rpmsg/rpmsg_core.c
> @@ -386,7 +386,9 @@ ATTRIBUTE_GROUPS(rpmsg_dev);
> static inline int rpmsg_id_match(const struct rpmsg_device *rpdev,
> const struct rpmsg_device_id *id)
> {
> - return strncmp(id->name, rpdev->id.name, RPMSG_NAME_SIZE) == 0;
> + size_t len = strnlen(id->name, RPMSG_NAME_SIZE);
> +
> + return strncmp(id->name, rpdev->id.name, len) == 0;
> }
>
> /* match rpmsg channel and rpmsg driver */
[Severity: High]
Since this unconditionally changes bus matching to prefix matching for all
drivers, will this cause a regression for existing drivers that rely on
exact match semantics?
For example, if a driver like rpmsg_wwan_ctrl expects an exact match:
drivers/net/wwan/rpmsg_wwan_ctrl.c:
static const struct rpmsg_device_id rpmsg_wwan_ctrl_id_table[] = {
{ .name = "DATA1", .driver_data = WWAN_PORT_AT },
...
};
Could this now erroneously bind to overlapping device names like "DATA10",
leading to unpredictable behavior? This breakage in exact match semantics
does not appear to be addressed in subsequent patches in the series.
[Severity: High]
With driver matching now operating by prefix, does this introduce a
regression for module autoloading with dynamically suffixed devices?
When the device is discovered, rpmsg_uevent() emits the full device name:
drivers/rpmsg/rpmsg_core.c:rpmsg_uevent() {
...
return add_uevent_var(env, "MODALIAS=" RPMSG_DEVICE_MODALIAS_FMT,
rpdev->id.name);
}
However, scripts/mod/file2alias.c:do_rpmsg_entry() does not append a
wildcard when generating the alias:
scripts/mod/file2alias.c:do_rpmsg_entry() {
...
module_alias_printf(mod, false, RPMSG_DEVICE_MODALIAS_FMT, *name);
}
Because the exported module alias is strictly exact (e.g., alias
rpmsg:rpmsg-io-), will udev fail to load the module for a device named
"rpmsg-io-0" since the required wildcard '*' is missing? This omission
doesn't seem to be fixed later in the patch series.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260923184255.299034-1-shenwei.wang@oss.nxp.com?part=3
next prev parent reply other threads:[~2026-09-23 18:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 18:42 [PATCH v16 0/5] Enable Remote GPIO over RPMSG on i.MX Platform Shenwei Wang
2026-09-23 18:42 ` [PATCH v16 1/5] docs: driver-api: gpio: rpmsg gpio driver over rpmsg bus Shenwei Wang
2026-09-23 18:50 ` sashiko-bot
2026-09-23 18:42 ` [PATCH v16 2/5] dt-bindings: remoteproc: imx_rproc: Add "rpmsg" subnode support Shenwei Wang
2026-09-23 18:52 ` sashiko-bot
2026-09-24 17:35 ` Conor Dooley
2026-10-06 3:07 ` Rob Herring
2026-10-06 15:18 ` Mathieu Poirier
2026-10-06 18:02 ` Rob Herring
2026-09-23 18:42 ` [PATCH v16 3/5] rpmsg: core: match rpmsg device IDs by prefix Shenwei Wang
2026-09-23 18:59 ` sashiko-bot [this message]
2026-09-23 18:42 ` [PATCH v16 4/5] gpio: rpmsg: add generic rpmsg GPIO driver Shenwei Wang
2026-09-23 18:57 ` sashiko-bot
2026-09-23 20:25 ` Andrew Davis
2026-09-23 18:42 ` [PATCH v16 5/5] arm64: dts: imx8ulp: Add rpmsg node under imx_rproc Shenwei Wang
2026-09-23 18:54 ` sashiko-bot
2026-09-24 14:54 ` [PATCH v16 0/5] Enable Remote GPIO over RPMSG on i.MX Platform Mathieu Poirier
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=20260923185931.C52C01F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=imx@lists.linux.dev \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=shenwei.wang@oss.nxp.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