* [PATCH v2 0/4] firmware: arm_scmi: Some fixes to address conflicts with fw_devlink
@ 2026-10-05 9:04 Sudeep Holla
2026-10-05 9:04 ` [PATCH v2 1/4] firmware: arm_scmi: Avoid protocol devices in exclusive raw mode Sudeep Holla
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Sudeep Holla @ 2026-10-05 9:04 UTC (permalink / raw)
To: arm-scmi, linux-arm-kernel
Cc: Sudeep Holla, Cristian Marussi, Peng Fan, Hans de Goede, imx,
linux-gpio, Pengutronix Kernel Team, NXP S32 Linux Team,
Linus Walleij
Peng’s [1] identified the problem of multiple SCMI devices sharing one
protocol fwnode. His [2] shows the consequence: the first device owns
the fwnode but does not bind, so fw_devlink can leave consumers deferred
even when another device binds successfully.
This four-patch series reduces those cases within SCMI. It prevents
protocol device creation in exclusive raw mode, stops treating core
created standard devices as driver owned requests, and makes the i.MX
pinctrl driver match the standard `pinctrl` device instead of creating
a second device for the same fwnode. It also omits the `perf` device
when the firmware node does not describe a performance domain provider,
without changing `cpufreq` device creation. IIO/HWMON don't have any
fw_devlink dependency and having two devices shouldn't be an issue.
These changes address the SCMI cases above; they do not provide a
general driver core solution for devices that share a fwnode.
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
[1] https://lore.kernel.org/all/20250120-scmi-fwdevlink-v2-0-3af2fa37dbac@nxp.com
[2] https://lore.kernel.org/all/20260928-driver-core-v1-1-0846bb8e0f32@nxp.com
---
Changes in v2:
- Dropped "pinctrl-imx" from scmi_std_id_table array correctly this time.
- Updated the trailers received so far(Thanks Peng Fan and Hans de Goede)
- Link to v1: https://patch.msgid.link/20261002-scmi_bus_fixes-v1-0-8695cbab3fe7@kernel.org
---
Sudeep Holla (4):
firmware: arm_scmi: Avoid protocol devices in exclusive raw mode
firmware: arm_scmi: Skip requests for standard protocol devices
pinctrl: imx: Match the standard SCMI pinctrl device
firmware: arm_scmi: Skip unused performance-domain devices
drivers/firmware/arm_scmi/bus.c | 106 +++++++++++++++++----------
drivers/pinctrl/freescale/pinctrl-imx-scmi.c | 2 +-
2 files changed, 67 insertions(+), 41 deletions(-)
---
base-commit: aac4e67d6eb93118cfa70c6562b5f9c81a7042ef
change-id: 20261002-scmi_bus_fixes-19bfe8d3c8e2
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 1/4] firmware: arm_scmi: Avoid protocol devices in exclusive raw mode
2026-10-05 9:04 [PATCH v2 0/4] firmware: arm_scmi: Some fixes to address conflicts with fw_devlink Sudeep Holla
@ 2026-10-05 9:04 ` Sudeep Holla
2026-10-05 9:04 ` [PATCH v2 2/4] firmware: arm_scmi: Skip requests for standard protocol devices Sudeep Holla
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2026-10-05 9:04 UTC (permalink / raw)
To: arm-scmi, linux-arm-kernel
Cc: Sudeep Holla, Cristian Marussi, Peng Fan, Hans de Goede, imx,
linux-gpio
Since standard protocol devices are created without a driver request,
rejecting SCMI driver registration is no longer enough to prevent them
from appearing when raw mode is enabled without coexistence.
When raw-mode debugfs setup succeeds, scmi_probe() returns success
before protocol enumeration, so it does not normally create those
devices. That early return is not sufficient: scmi_device_create() is
exported and can be called later.
Skip protocol-device creation in exclusive raw mode, including named
non-transport requests. Keep named transport devices so raw mode can
still set up its channels. Share the raw-mode condition and transport
name check with the existing bus paths.
Cc: Hans de Goede <johannes.goede@oss.qualcomm.com>
Fixes: aac4e67d6eb9 ("firmware: arm_scmi: Always create devices for standard protocols")
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Tested-by: Peng Fan <peng.fan@nxp.com> #i.MX95 EVK
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
---
drivers/firmware/arm_scmi/bus.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index 25197197db8e..f2e2ed56bc32 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -36,6 +36,12 @@ struct scmi_requested_dev {
/* Track globally the SCMI SystemPower protocol device. */
static struct scmi_device *scmi_syspower_registered;
+static bool scmi_raw_mode_only(void)
+{
+ return IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT) &&
+ !IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT_COEX);
+}
+
/**
* scmi_protocol_device_request - Helper to request a device
*
@@ -60,8 +66,7 @@ static int scmi_protocol_device_request(const struct scmi_device_id *id_table)
pr_debug("Requesting SCMI device (%s) for protocol %x\n",
id_table->name, id_table->protocol_id);
- if (IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT) &&
- !IS_ENABLED(CONFIG_ARM_SCMI_RAW_MODE_SUPPORT_COEX)) {
+ if (scmi_raw_mode_only()) {
pr_warn("SCMI Raw mode active. Rejecting '%s'/0x%02X\n",
id_table->name, id_table->protocol_id);
return -EINVAL;
@@ -210,12 +215,17 @@ scmi_protocol_table_unregister(const struct scmi_device_id *id_table)
scmi_protocol_device_unrequest(entry);
}
-static bool scmi_device_is_transport(const struct scmi_device *scmi_dev)
+static bool scmi_device_name_is_transport(const char *name)
{
- return !strncmp(scmi_dev->name, SCMI_TRANSPORT_DEVNAME_PREFIX,
+ return !strncmp(name, SCMI_TRANSPORT_DEVNAME_PREFIX,
strlen(SCMI_TRANSPORT_DEVNAME_PREFIX));
}
+static bool scmi_device_is_transport(const struct scmi_device *scmi_dev)
+{
+ return scmi_device_name_is_transport(scmi_dev->name);
+}
+
static int __scmi_dev_match_by_id_table(struct scmi_device *scmi_dev,
const struct scmi_device_id *id_table,
bool skip_transport)
@@ -591,6 +601,11 @@ struct scmi_device *scmi_device_create(struct fwnode_handle *fwnode,
struct scmi_requested_dev *rdev;
struct scmi_device *sdev, *scmi_dev = NULL;
+ /* Exclusive raw mode still needs transport devices for its channels. */
+ if (scmi_raw_mode_only() &&
+ (!name || !scmi_device_name_is_transport(name)))
+ return NULL;
+
if (name)
return _scmi_device_create(fwnode, parent, protocol, name);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/4] firmware: arm_scmi: Skip requests for standard protocol devices
2026-10-05 9:04 [PATCH v2 0/4] firmware: arm_scmi: Some fixes to address conflicts with fw_devlink Sudeep Holla
2026-10-05 9:04 ` [PATCH v2 1/4] firmware: arm_scmi: Avoid protocol devices in exclusive raw mode Sudeep Holla
@ 2026-10-05 9:04 ` Sudeep Holla
2026-10-05 9:18 ` sashiko-bot
2026-10-05 9:04 ` [PATCH v2 3/4] pinctrl: imx: Match the standard SCMI pinctrl device Sudeep Holla
2026-10-05 9:04 ` [PATCH v2 4/4] firmware: arm_scmi: Skip unused performance-domain devices Sudeep Holla
3 siblings, 1 reply; 8+ messages in thread
From: Sudeep Holla @ 2026-10-05 9:04 UTC (permalink / raw)
To: arm-scmi, linux-arm-kernel
Cc: Sudeep Holla, Cristian Marussi, Peng Fan, Hans de Goede, imx,
linux-gpio
The SCMI core creates devices for the standard protocol IDs during
protocol enumeration, without waiting for an SCMI driver request.
Recording a request for one of these devices also rejects a second
driver registering the same protocol/name pair.
When the first driver unregisters, unrequesting that pair destroys the
core-created device. No other driver can be bound to it at that point,
but removing it also removes the device that a later driver could bind
to or use for module autoloading.
Skip request tracking for standard devices. Keep request tracking and
rollback for nonstandard devices unchanged.
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Tested-by: Peng Fan <peng.fan@nxp.com> #i.MX95 EVK
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
---
drivers/firmware/arm_scmi/bus.c | 73 +++++++++++++++++++++++------------------
1 file changed, 41 insertions(+), 32 deletions(-)
diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index f2e2ed56bc32..230ee9f6f1aa 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -186,12 +186,44 @@ static void scmi_protocol_device_unrequest(const struct scmi_device_id *id_table
}
}
+/* Standard protocols table */
+static const struct scmi_device_id scmi_std_id_table[] = {
+ { SCMI_PROTOCOL_POWER, "genpd" },
+ { SCMI_PROTOCOL_SYSTEM, "syspower" },
+ { SCMI_PROTOCOL_PERF, "perf" },
+ { SCMI_PROTOCOL_PERF, "cpufreq" },
+ { SCMI_PROTOCOL_CLOCK, "clocks" },
+ { SCMI_PROTOCOL_SENSOR, "hwmon" },
+ { SCMI_PROTOCOL_SENSOR, "iiodev" },
+ { SCMI_PROTOCOL_RESET, "reset" },
+ { SCMI_PROTOCOL_VOLTAGE, "regulator" },
+ { SCMI_PROTOCOL_POWERCAP, "powercap" },
+ { SCMI_PROTOCOL_PINCTRL, "pinctrl" },
+ { SCMI_PROTOCOL_PINCTRL, "pinctrl-imx" },
+ { },
+};
+
+static bool scmi_device_id_in_std_id_table(const struct scmi_device_id *id)
+{
+ for (int i = 0; scmi_std_id_table[i].name[0]; i++) {
+ if (scmi_std_id_table[i].protocol_id == id->protocol_id &&
+ !strcmp(scmi_std_id_table[i].name, id->name))
+ return true;
+ }
+
+ return false;
+}
+
static int scmi_protocol_table_register(const struct scmi_device_id *id_table)
{
const struct scmi_device_id *entry;
int ret;
for (entry = id_table; entry->name[0]; entry++) {
+ /* Skip standard devices as they are created unconditionally */
+ if (scmi_device_id_in_std_id_table(entry))
+ continue;
+
ret = scmi_protocol_device_request(entry);
if (ret)
goto err_unrequest;
@@ -200,8 +232,11 @@ static int scmi_protocol_table_register(const struct scmi_device_id *id_table)
return 0;
err_unrequest:
- while (entry != id_table)
- scmi_protocol_device_unrequest(--entry);
+ while (entry != id_table) {
+ --entry;
+ if (!scmi_device_id_in_std_id_table(entry))
+ scmi_protocol_device_unrequest(entry);
+ }
return ret;
}
@@ -211,8 +246,10 @@ scmi_protocol_table_unregister(const struct scmi_device_id *id_table)
{
const struct scmi_device_id *entry;
- for (entry = id_table; entry->name[0]; entry++)
- scmi_protocol_device_unrequest(entry);
+ for (entry = id_table; entry->name[0]; entry++) {
+ if (!scmi_device_id_in_std_id_table(entry))
+ scmi_protocol_device_unrequest(entry);
+ }
}
static bool scmi_device_name_is_transport(const char *name)
@@ -542,34 +579,6 @@ _scmi_device_create(struct fwnode_handle *fwnode, struct device *parent,
return sdev;
}
-/* Standard protocols table */
-static const struct scmi_device_id scmi_std_id_table[] = {
- { SCMI_PROTOCOL_POWER, "genpd" },
- { SCMI_PROTOCOL_SYSTEM, "syspower" },
- { SCMI_PROTOCOL_PERF, "perf" },
- { SCMI_PROTOCOL_PERF, "cpufreq" },
- { SCMI_PROTOCOL_CLOCK, "clocks" },
- { SCMI_PROTOCOL_SENSOR, "hwmon" },
- { SCMI_PROTOCOL_SENSOR, "iiodev" },
- { SCMI_PROTOCOL_RESET, "reset" },
- { SCMI_PROTOCOL_VOLTAGE, "regulator" },
- { SCMI_PROTOCOL_POWERCAP, "powercap" },
- { SCMI_PROTOCOL_PINCTRL, "pinctrl" },
- { SCMI_PROTOCOL_PINCTRL, "pinctrl-imx" },
- { },
-};
-
-static bool scmi_device_id_in_std_id_table(const struct scmi_device_id *id)
-{
- for (int i = 0; scmi_std_id_table[i].name[0]; i++) {
- if (scmi_std_id_table[i].protocol_id == id->protocol_id &&
- !strcmp(scmi_std_id_table[i].name, id->name))
- return true;
- }
-
- return false;
-}
-
/**
* scmi_device_create - A method to create one or more SCMI devices
*
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/4] pinctrl: imx: Match the standard SCMI pinctrl device
2026-10-05 9:04 [PATCH v2 0/4] firmware: arm_scmi: Some fixes to address conflicts with fw_devlink Sudeep Holla
2026-10-05 9:04 ` [PATCH v2 1/4] firmware: arm_scmi: Avoid protocol devices in exclusive raw mode Sudeep Holla
2026-10-05 9:04 ` [PATCH v2 2/4] firmware: arm_scmi: Skip requests for standard protocol devices Sudeep Holla
@ 2026-10-05 9:04 ` Sudeep Holla
2026-10-07 11:17 ` Linus Walleij
2026-10-05 9:04 ` [PATCH v2 4/4] firmware: arm_scmi: Skip unused performance-domain devices Sudeep Holla
3 siblings, 1 reply; 8+ messages in thread
From: Sudeep Holla @ 2026-10-05 9:04 UTC (permalink / raw)
To: arm-scmi, linux-arm-kernel
Cc: Sudeep Holla, Cristian Marussi, Peng Fan, Hans de Goede, imx,
linux-gpio, Pengutronix Kernel Team, NXP S32 Linux Team,
Linus Walleij
Use the standard "pinctrl" SCMI device name instead of the i.MX-specific
"pinctrl-imx" name. Standard devices no longer have exclusive request
tracking, so the i.MX and generic pinctrl drivers can register for the
same protocol/name pair. Their probe checks select the appropriate
driver for the platform.
This solves the issue that occurs when both "pinmux" and "pinmux-imx"
devices that share the same fwnode as only the first device registered
is assigned as the owner of the fwnode. If this owner device fails to
probe (e.g., its driver is blocklisted or missing), it never reaches
the driver_bound() stage and the system skips cleaning up its supplier
links. Even if a alternative device binds successfully, the system
still looks to the broken original owner. As a result, all dependent
hardware components (I2C, SPI, UART, USB, MMC, PCIe) defer probing
forever, halting the boot process.
Note that the solution doesn't support same fwnode being shared by
multiple devices and associated fw_devlink feature.
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: NXP S32 Linux Team <s32@nxp.com>
Cc: Linus Walleij <linusw@kernel.org>
Reported-by: Peng Fan <peng.fan@nxp.com>
Closes: https://lore.kernel.org/all/20260928-driver-core-v1-1-0846bb8e0f32@nxp.com
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Tested-by: Peng Fan <peng.fan@nxp.com> #i.MX95 EVK
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
---
drivers/firmware/arm_scmi/bus.c | 1 -
drivers/pinctrl/freescale/pinctrl-imx-scmi.c | 2 +-
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index 230ee9f6f1aa..6be31b5121b3 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -199,7 +199,6 @@ static const struct scmi_device_id scmi_std_id_table[] = {
{ SCMI_PROTOCOL_VOLTAGE, "regulator" },
{ SCMI_PROTOCOL_POWERCAP, "powercap" },
{ SCMI_PROTOCOL_PINCTRL, "pinctrl" },
- { SCMI_PROTOCOL_PINCTRL, "pinctrl-imx" },
{ },
};
diff --git a/drivers/pinctrl/freescale/pinctrl-imx-scmi.c b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c
index 613552e35070..b259a526ccc1 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx-scmi.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx-scmi.c
@@ -354,7 +354,7 @@ static int scmi_pinctrl_imx_probe(struct scmi_device *sdev)
}
static const struct scmi_device_id scmi_id_table[] = {
- { SCMI_PROTOCOL_PINCTRL, "pinctrl-imx" },
+ { SCMI_PROTOCOL_PINCTRL, "pinctrl" },
{ }
};
MODULE_DEVICE_TABLE(scmi, scmi_id_table);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/4] firmware: arm_scmi: Skip unused performance-domain devices
2026-10-05 9:04 [PATCH v2 0/4] firmware: arm_scmi: Some fixes to address conflicts with fw_devlink Sudeep Holla
` (2 preceding siblings ...)
2026-10-05 9:04 ` [PATCH v2 3/4] pinctrl: imx: Match the standard SCMI pinctrl device Sudeep Holla
@ 2026-10-05 9:04 ` Sudeep Holla
3 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2026-10-05 9:04 UTC (permalink / raw)
To: arm-scmi, linux-arm-kernel
Cc: Sudeep Holla, Cristian Marussi, Peng Fan, Hans de Goede, imx,
linux-gpio
The SCMI performance-domain driver uses the named "perf" device only
when its firmware node declares #power-domain-cells. Otherwise its
probe returns without registering a provider, while the same SCMI
protocol may still be needed by the separate "cpufreq" device.
Do not create the "perf" device when the provider property is absent.
This avoids an unnecessary device claiming the protocol fwnode and
leaves cpufreq creation unchanged. Update the device-creation contract
to document that an intentionally omitted named device returns NULL.
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Tested-by: Peng Fan <peng.fan@nxp.com> #i.MX95 EVK
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
---
drivers/firmware/arm_scmi/bus.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
index 6be31b5121b3..b235d322330b 100644
--- a/drivers/firmware/arm_scmi/bus.c
+++ b/drivers/firmware/arm_scmi/bus.c
@@ -570,6 +570,11 @@ _scmi_device_create(struct fwnode_handle *fwnode, struct device *parent,
{
struct scmi_device *sdev;
+ /* The perf device is only needed when it provides power domains. */
+ if (protocol == SCMI_PROTOCOL_PERF && !strcmp(name, "perf") &&
+ !fwnode_property_present(fwnode, "#power-domain-cells"))
+ return NULL;
+
sdev = __scmi_device_create(fwnode, parent, protocol, name);
if (!sdev)
pr_err("(%pfwf) Failed to create device - protocol 0x%x (%s)\n",
@@ -596,10 +601,8 @@ _scmi_device_create(struct fwnode_handle *fwnode, struct device *parent,
*
* Return: The created device (or one of them if @name was NOT provided and
* multiple devices were created) or NULL if no device was created;
- * note that NULL indicates an error ONLY in case a specific @name
- * was provided: when @name param was not provided, a number of devices
- * could have been potentially created for a whole protocol, unless no
- * device was found to have been requested for that specific protocol.
+ * note that NULL can also indicate that a named device is not needed
+ * for this fwnode, or that no device was requested when @name is NULL.
*/
struct scmi_device *scmi_device_create(struct fwnode_handle *fwnode,
struct device *parent, int protocol,
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/4] firmware: arm_scmi: Skip requests for standard protocol devices
2026-10-05 9:04 ` [PATCH v2 2/4] firmware: arm_scmi: Skip requests for standard protocol devices Sudeep Holla
@ 2026-10-05 9:18 ` sashiko-bot
2026-10-05 9:31 ` Sudeep Holla
0 siblings, 1 reply; 8+ messages in thread
From: sashiko-bot @ 2026-10-05 9:18 UTC (permalink / raw)
To: Sudeep Holla; +Cc: linux-gpio, imx, Frank.Li
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] arm_scmi: dead code in scmi_device_create() for standard devices
--
commit cb938ad959a8195c8129d8e6f7596ff9fd2ddff8
Author: Sudeep Holla <sudeep.holla@kernel.org>
firmware: arm_scmi: Skip requests for standard protocol devices
The SCMI core skips request tracking for standard protocol devices to avoid
issues when unregistered drivers destroy the core-created device. Keep
request tracking and rollback for nonstandard devices unchanged.
> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> index f2e2ed56bc326..230ee9f6f1aa5 100644
> --- a/drivers/firmware/arm_scmi/bus.c
> +++ b/drivers/firmware/arm_scmi/bus.c
> @@ -186,12 +186,44 @@ static void scmi_protocol_device_unrequest(const struct scmi_device_id *id_table
[ ... ]
> static int scmi_protocol_table_register(const struct scmi_device_id *id_table)
> {
> const struct scmi_device_id *entry;
> int ret;
>
> for (entry = id_table; entry->name[0]; entry++) {
> + /* Skip standard devices as they are created unconditionally */
> + if (scmi_device_id_in_std_id_table(entry))
> + continue;
> +
> ret = scmi_protocol_device_request(entry);
> if (ret)
> goto err_unrequest;
[Severity: Low]
Does this change make the check for standard devices in scmi_device_create()
obsolete?
Since standard devices are no longer passed to scmi_protocol_device_request(),
they aren't added to the scmi_requested_devices IDR. When scmi_device_create()
subsequently walks the requested list, phead will only contain non-standard
devices:
drivers/firmware/arm_scmi/bus.c:scmi_device_create() {
...
/* Walk the list of requested devices for protocol and create them */
list_for_each_entry(rdev, phead, node) {
/* Standard proto matches already have their dev created above */
if (scmi_device_id_in_std_id_table(rdev->id_table))
continue;
...
}
Will this check in scmi_device_create() always evaluate to false now, making
it dead code?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261005-scmi_bus_fixes-v2-0-34a51338875a@kernel.org?part=2
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/4] firmware: arm_scmi: Skip requests for standard protocol devices
2026-10-05 9:18 ` sashiko-bot
@ 2026-10-05 9:31 ` Sudeep Holla
0 siblings, 0 replies; 8+ messages in thread
From: Sudeep Holla @ 2026-10-05 9:31 UTC (permalink / raw)
To: sashiko-reviews; +Cc: linux-gpio, imx, Frank.Li, Sudeep Holla
On Mon, Oct 05, 2026 at 09:18:42AM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Low] arm_scmi: dead code in scmi_device_create() for standard devices
> --
>
> commit cb938ad959a8195c8129d8e6f7596ff9fd2ddff8
> Author: Sudeep Holla <sudeep.holla@kernel.org>
>
> firmware: arm_scmi: Skip requests for standard protocol devices
>
> The SCMI core skips request tracking for standard protocol devices to avoid
> issues when unregistered drivers destroy the core-created device. Keep
> request tracking and rollback for nonstandard devices unchanged.
>
> > diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c
> > index f2e2ed56bc326..230ee9f6f1aa5 100644
> > --- a/drivers/firmware/arm_scmi/bus.c
> > +++ b/drivers/firmware/arm_scmi/bus.c
> > @@ -186,12 +186,44 @@ static void scmi_protocol_device_unrequest(const struct scmi_device_id *id_table
> [ ... ]
> > static int scmi_protocol_table_register(const struct scmi_device_id *id_table)
> > {
> > const struct scmi_device_id *entry;
> > int ret;
> >
> > for (entry = id_table; entry->name[0]; entry++) {
> > + /* Skip standard devices as they are created unconditionally */
> > + if (scmi_device_id_in_std_id_table(entry))
> > + continue;
> > +
> > ret = scmi_protocol_device_request(entry);
> > if (ret)
> > goto err_unrequest;
>
> [Severity: Low]
> Does this change make the check for standard devices in scmi_device_create()
> obsolete?
>
> Since standard devices are no longer passed to scmi_protocol_device_request(),
> they aren't added to the scmi_requested_devices IDR. When scmi_device_create()
> subsequently walks the requested list, phead will only contain non-standard
> devices:
>
> drivers/firmware/arm_scmi/bus.c:scmi_device_create() {
> ...
> /* Walk the list of requested devices for protocol and create them */
> list_for_each_entry(rdev, phead, node) {
> /* Standard proto matches already have their dev created above */
> if (scmi_device_id_in_std_id_table(rdev->id_table))
> continue;
> ...
> }
>
> Will this check in scmi_device_create() always evaluate to false now, making
> it dead code?
>
Agreed! It can be removed.
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20261005-scmi_bus_fixes-v2-0-34a51338875a@kernel.org?part=2
--
Regards,
Sudeep
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 3/4] pinctrl: imx: Match the standard SCMI pinctrl device
2026-10-05 9:04 ` [PATCH v2 3/4] pinctrl: imx: Match the standard SCMI pinctrl device Sudeep Holla
@ 2026-10-07 11:17 ` Linus Walleij
0 siblings, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2026-10-07 11:17 UTC (permalink / raw)
To: Sudeep Holla
Cc: arm-scmi, linux-arm-kernel, Cristian Marussi, Peng Fan,
Hans de Goede, imx, linux-gpio, Pengutronix Kernel Team,
NXP S32 Linux Team
On Mon, Oct 5, 2026 at 11:06 AM Sudeep Holla <sudeep.holla@kernel.org> wrote:
> Use the standard "pinctrl" SCMI device name instead of the i.MX-specific
> "pinctrl-imx" name. Standard devices no longer have exclusive request
> tracking, so the i.MX and generic pinctrl drivers can register for the
> same protocol/name pair. Their probe checks select the appropriate
> driver for the platform.
>
> This solves the issue that occurs when both "pinmux" and "pinmux-imx"
> devices that share the same fwnode as only the first device registered
> is assigned as the owner of the fwnode. If this owner device fails to
> probe (e.g., its driver is blocklisted or missing), it never reaches
> the driver_bound() stage and the system skips cleaning up its supplier
> links. Even if a alternative device binds successfully, the system
> still looks to the broken original owner. As a result, all dependent
> hardware components (I2C, SPI, UART, USB, MMC, PCIe) defer probing
> forever, halting the boot process.
>
> Note that the solution doesn't support same fwnode being shared by
> multiple devices and associated fw_devlink feature.
>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: NXP S32 Linux Team <s32@nxp.com>
> Cc: Linus Walleij <linusw@kernel.org>
> Reported-by: Peng Fan <peng.fan@nxp.com>
> Closes: https://lore.kernel.org/all/20260928-driver-core-v1-1-0846bb8e0f32@nxp.com
> Reviewed-by: Peng Fan <peng.fan@nxp.com>
> Tested-by: Peng Fan <peng.fan@nxp.com> #i.MX95 EVK
> Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
Acked-by: Linus Walleij <linusw@kernel.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-10-07 11:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-05 9:04 [PATCH v2 0/4] firmware: arm_scmi: Some fixes to address conflicts with fw_devlink Sudeep Holla
2026-10-05 9:04 ` [PATCH v2 1/4] firmware: arm_scmi: Avoid protocol devices in exclusive raw mode Sudeep Holla
2026-10-05 9:04 ` [PATCH v2 2/4] firmware: arm_scmi: Skip requests for standard protocol devices Sudeep Holla
2026-10-05 9:18 ` sashiko-bot
2026-10-05 9:31 ` Sudeep Holla
2026-10-05 9:04 ` [PATCH v2 3/4] pinctrl: imx: Match the standard SCMI pinctrl device Sudeep Holla
2026-10-07 11:17 ` Linus Walleij
2026-10-05 9:04 ` [PATCH v2 4/4] firmware: arm_scmi: Skip unused performance-domain devices Sudeep Holla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox