* [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading
@ 2026-06-18 15:56 Bjorn Andersson
2026-06-18 15:56 ` [PATCH v2 1/2] module: add SCMI device table alias support Bjorn Andersson
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Bjorn Andersson @ 2026-06-18 15:56 UTC (permalink / raw)
To: Sudeep Holla, Cristian Marussi, Nathan Chancellor, Nicolas Schier,
Michael Turquette
Cc: arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild,
Hans de Goede, Bjorn Andersson, Stephen Boyd, Brian Masney,
Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer,
Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck,
Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood,
Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm,
imx, linux-hwmon, linux-iio, linux-input, linux-rtc
SCMI drivers such as the Arm SCMI CPUfreq driver are allowed to built as
modules, but they are then not automatically loaded. Rework the SCMI
device table alias support to make modpost consume the information from
MODULE_DEVICE_TABLE(scmi, ...) and allow drivers to be loaded based on
this information, if known. Also add a protocol-based alias to also
trigger driver loading when only the SCMI protocol id is known.
Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
---
Changes in v2:
- Use request_module_nowait()
- Drop #include <linux/mod_devicetable.h> from scmi_protocol.h
- Link to v1: https://patch.msgid.link/20260616-scmi-modalias-v1-0-662b8dd52ab2@oss.qualcomm.com
To: Sudeep Holla <sudeep.holla@kernel.org>
To: Cristian Marussi <cristian.marussi@arm.com>
To: Michael Turquette <mturquette@baylibre.com>
To: Nicolas Schier <nsc@kernel.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: Brian Masney <bmasney@redhat.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Frank Li <Frank.Li@nxp.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Jyoti Bhayana <jbhayana@google.com>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: David Lechner <dlechner@baylibre.com>
Cc: Nuno Sá <nuno.sa@analog.com>
Cc: Andy Shevchenko <andy@kernel.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Ulf Hansson <ulfh@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: arm-scmi@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: imx@lists.linux.dev
Cc: linux-hwmon@vger.kernel.org
Cc: linux-iio@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-rtc@vger.kernel.org
Cc: linux-kbuild@vger.kernel.org
---
Bjorn Andersson (2):
module: add SCMI device table alias support
firmware: arm_scmi: request modules for discovered protocols
drivers/clk/clk-scmi.c | 1 +
drivers/cpufreq/scmi-cpufreq.c | 1 +
drivers/firmware/arm_scmi/bus.c | 20 ++++++++++----------
drivers/firmware/arm_scmi/driver.c | 3 +++
drivers/firmware/arm_scmi/scmi_power_control.c | 1 +
drivers/firmware/imx/sm-cpu.c | 1 +
drivers/firmware/imx/sm-lmm.c | 1 +
drivers/firmware/imx/sm-misc.c | 1 +
drivers/hwmon/scmi-hwmon.c | 1 +
drivers/iio/common/scmi_sensors/scmi_iio.c | 1 +
drivers/input/keyboard/imx-sm-bbm-key.c | 1 +
drivers/pmdomain/arm/scmi_perf_domain.c | 1 +
drivers/pmdomain/arm/scmi_pm_domain.c | 1 +
drivers/powercap/arm_scmi_powercap.c | 1 +
drivers/regulator/scmi-regulator.c | 1 +
drivers/reset/reset-scmi.c | 1 +
drivers/rtc/rtc-imx-sm-bbm.c | 1 +
include/linux/mod_devicetable.h | 12 ++++++++++++
include/linux/scmi_protocol.h | 5 +----
scripts/mod/devicetable-offsets.c | 4 ++++
scripts/mod/file2alias.c | 13 +++++++++++++
21 files changed, 58 insertions(+), 14 deletions(-)
---
base-commit: 8d6dbbbe3ba62de0a63e962ee004afb848c8e3ac
change-id: 20260616-scmi-modalias-0f32421bd452
Best regards,
--
Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH v2 1/2] module: add SCMI device table alias support 2026-06-18 15:56 [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading Bjorn Andersson @ 2026-06-18 15:56 ` Bjorn Andersson 2026-06-18 18:16 ` Frank Li 2026-06-18 15:56 ` [PATCH v2 2/2] firmware: arm_scmi: request modules for discovered protocols Bjorn Andersson 2026-06-18 20:31 ` [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading Hans de Goede 2 siblings, 1 reply; 15+ messages in thread From: Bjorn Andersson @ 2026-06-18 15:56 UTC (permalink / raw) To: Sudeep Holla, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette Cc: arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Hans de Goede, Bjorn Andersson, Stephen Boyd, Brian Masney, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc SCMI client drivers already describe their bus match data with MODULE_DEVICE_TABLE(scmi, ...), but modpost does not know how to consume SCMI device tables. As a result, SCMI modules do not get generated module aliases from their id tables. Move struct scmi_device_id to mod_devicetable.h so it has a fixed layout visible to modpost, add the corresponding generated offsets and teach file2alias to emit scmi:<protocol>:<name> aliases. Use the same stable alias format for SCMI device uevents and sysfs modaliases. The previous string included the instance-specific device name, which is not useful for matching modules. Assisted-by: Codex:GPT-5.5 Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> --- drivers/clk/clk-scmi.c | 1 + drivers/cpufreq/scmi-cpufreq.c | 1 + drivers/firmware/arm_scmi/bus.c | 20 ++++++++++---------- drivers/firmware/arm_scmi/driver.c | 1 + drivers/firmware/arm_scmi/scmi_power_control.c | 1 + drivers/firmware/imx/sm-cpu.c | 1 + drivers/firmware/imx/sm-lmm.c | 1 + drivers/firmware/imx/sm-misc.c | 1 + drivers/hwmon/scmi-hwmon.c | 1 + drivers/iio/common/scmi_sensors/scmi_iio.c | 1 + drivers/input/keyboard/imx-sm-bbm-key.c | 1 + drivers/pmdomain/arm/scmi_perf_domain.c | 1 + drivers/pmdomain/arm/scmi_pm_domain.c | 1 + drivers/powercap/arm_scmi_powercap.c | 1 + drivers/regulator/scmi-regulator.c | 1 + drivers/reset/reset-scmi.c | 1 + drivers/rtc/rtc-imx-sm-bbm.c | 1 + include/linux/mod_devicetable.h | 11 +++++++++++ include/linux/scmi_protocol.h | 5 +---- scripts/mod/devicetable-offsets.c | 4 ++++ scripts/mod/file2alias.c | 11 +++++++++++ 21 files changed, 53 insertions(+), 14 deletions(-) diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c index 7c562559ad8b..b9e29e124302 100644 --- a/drivers/clk/clk-scmi.c +++ b/drivers/clk/clk-scmi.c @@ -11,6 +11,7 @@ #include <linux/err.h> #include <linux/of.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/scmi_protocol.h> #define NOT_ATOMIC false diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 4edb4f7a8aa9..affa005bf8b1 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -15,6 +15,7 @@ #include <linux/energy_model.h> #include <linux/export.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/of.h> #include <linux/pm_opp.h> #include <linux/pm_qos.h> diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index 793be9eabaed..70781146fa61 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -10,14 +10,16 @@ #include <linux/atomic.h> #include <linux/types.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/of.h> #include <linux/kernel.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/device.h> #include "common.h" -#define SCMI_UEVENT_MODALIAS_FMT "%s:%02x:%s" +#define SCMI_UEVENT_MODALIAS_FMT SCMI_MODULE_PREFIX "%02x:%s" BLOCKING_NOTIFIER_HEAD(scmi_requested_devices_nh); EXPORT_SYMBOL_GPL(scmi_requested_devices_nh); @@ -141,7 +143,7 @@ static int scmi_protocol_table_register(const struct scmi_device_id *id_table) int ret = 0; const struct scmi_device_id *entry; - for (entry = id_table; entry->name && ret == 0; entry++) + for (entry = id_table; entry->name[0] && ret == 0; entry++) ret = scmi_protocol_device_request(entry); return ret; @@ -197,18 +199,18 @@ scmi_protocol_table_unregister(const struct scmi_device_id *id_table) { const struct scmi_device_id *entry; - for (entry = id_table; entry->name; entry++) + for (entry = id_table; entry->name[0]; entry++) scmi_protocol_device_unrequest(entry); } static int scmi_dev_match_by_id_table(struct scmi_device *scmi_dev, const struct scmi_device_id *id_table) { - if (!id_table || !id_table->name) + if (!id_table || !id_table->name[0]) return 0; /* Always skip transport devices from matching */ - for (; id_table->protocol_id && id_table->name; id_table++) + for (; id_table->protocol_id && id_table->name[0]; id_table++) if (id_table->protocol_id == scmi_dev->protocol_id && strncmp(scmi_dev->name, "__scmi_transport_device", 23) && !strcmp(id_table->name, scmi_dev->name)) @@ -245,7 +247,7 @@ static struct scmi_device *scmi_child_dev_find(struct device *parent, struct device *dev; id_table[0].protocol_id = prot_id; - id_table[0].name = name; + strscpy(id_table[0].name, name, sizeof(id_table[0].name)); dev = device_find_child(parent, &id_table, scmi_match_by_id_table); if (!dev) @@ -282,8 +284,7 @@ static int scmi_device_uevent(const struct device *dev, struct kobj_uevent_env * const struct scmi_device *scmi_dev = to_scmi_dev(dev); return add_uevent_var(env, "MODALIAS=" SCMI_UEVENT_MODALIAS_FMT, - dev_name(&scmi_dev->dev), scmi_dev->protocol_id, - scmi_dev->name); + scmi_dev->protocol_id, scmi_dev->name); } static ssize_t modalias_show(struct device *dev, @@ -292,8 +293,7 @@ static ssize_t modalias_show(struct device *dev, struct scmi_device *scmi_dev = to_scmi_dev(dev); return sysfs_emit(buf, SCMI_UEVENT_MODALIAS_FMT, - dev_name(&scmi_dev->dev), scmi_dev->protocol_id, - scmi_dev->name); + scmi_dev->protocol_id, scmi_dev->name); } static DEVICE_ATTR_RO(modalias); diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 3e0d975ec94c..0fd6a947499e 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -30,6 +30,7 @@ #include <linux/hashtable.h> #include <linux/list.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/processor.h> diff --git a/drivers/firmware/arm_scmi/scmi_power_control.c b/drivers/firmware/arm_scmi/scmi_power_control.c index 955736336061..1900bb77383e 100644 --- a/drivers/firmware/arm_scmi/scmi_power_control.c +++ b/drivers/firmware/arm_scmi/scmi_power_control.c @@ -45,6 +45,7 @@ #include <linux/math.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/mutex.h> #include <linux/pm.h> #include <linux/printk.h> diff --git a/drivers/firmware/imx/sm-cpu.c b/drivers/firmware/imx/sm-cpu.c index 091b014f739f..53a8d1cee5ea 100644 --- a/drivers/firmware/imx/sm-cpu.c +++ b/drivers/firmware/imx/sm-cpu.c @@ -5,6 +5,7 @@ #include <linux/firmware/imx/sm.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/scmi_protocol.h> diff --git a/drivers/firmware/imx/sm-lmm.c b/drivers/firmware/imx/sm-lmm.c index 6807bf563c03..f4dc198187a8 100644 --- a/drivers/firmware/imx/sm-lmm.c +++ b/drivers/firmware/imx/sm-lmm.c @@ -5,6 +5,7 @@ #include <linux/firmware/imx/sm.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/scmi_protocol.h> diff --git a/drivers/firmware/imx/sm-misc.c b/drivers/firmware/imx/sm-misc.c index ac9af824c2d4..5e39e79a9d8a 100644 --- a/drivers/firmware/imx/sm-misc.c +++ b/drivers/firmware/imx/sm-misc.c @@ -7,6 +7,7 @@ #include <linux/device/devres.h> #include <linux/firmware/imx/sm.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/scmi_protocol.h> diff --git a/drivers/hwmon/scmi-hwmon.c b/drivers/hwmon/scmi-hwmon.c index eec223d174c0..57b91e931c5d 100644 --- a/drivers/hwmon/scmi-hwmon.c +++ b/drivers/hwmon/scmi-hwmon.c @@ -8,6 +8,7 @@ #include <linux/hwmon.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/scmi_protocol.h> #include <linux/slab.h> #include <linux/sysfs.h> diff --git a/drivers/iio/common/scmi_sensors/scmi_iio.c b/drivers/iio/common/scmi_sensors/scmi_iio.c index 442b40ef27cf..3babc4261965 100644 --- a/drivers/iio/common/scmi_sensors/scmi_iio.c +++ b/drivers/iio/common/scmi_sensors/scmi_iio.c @@ -15,6 +15,7 @@ #include <linux/kernel.h> #include <linux/kthread.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/mutex.h> #include <linux/scmi_protocol.h> #include <linux/time.h> diff --git a/drivers/input/keyboard/imx-sm-bbm-key.c b/drivers/input/keyboard/imx-sm-bbm-key.c index 96486bd23d60..36e349136ee7 100644 --- a/drivers/input/keyboard/imx-sm-bbm-key.c +++ b/drivers/input/keyboard/imx-sm-bbm-key.c @@ -6,6 +6,7 @@ #include <linux/input.h> #include <linux/jiffies.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/of.h> #include <linux/platform_device.h> #include <linux/rtc.h> diff --git a/drivers/pmdomain/arm/scmi_perf_domain.c b/drivers/pmdomain/arm/scmi_perf_domain.c index 3693423459c9..741375ad325b 100644 --- a/drivers/pmdomain/arm/scmi_perf_domain.c +++ b/drivers/pmdomain/arm/scmi_perf_domain.c @@ -8,6 +8,7 @@ #include <linux/err.h> #include <linux/device.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/pm_domain.h> #include <linux/pm_opp.h> #include <linux/scmi_protocol.h> diff --git a/drivers/pmdomain/arm/scmi_pm_domain.c b/drivers/pmdomain/arm/scmi_pm_domain.c index 3d73aef21d2f..0948d05c9e3c 100644 --- a/drivers/pmdomain/arm/scmi_pm_domain.c +++ b/drivers/pmdomain/arm/scmi_pm_domain.c @@ -8,6 +8,7 @@ #include <linux/err.h> #include <linux/io.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/pm_domain.h> #include <linux/scmi_protocol.h> diff --git a/drivers/powercap/arm_scmi_powercap.c b/drivers/powercap/arm_scmi_powercap.c index ab66e9a3b1e2..332e4e26f1e5 100644 --- a/drivers/powercap/arm_scmi_powercap.c +++ b/drivers/powercap/arm_scmi_powercap.c @@ -10,6 +10,7 @@ #include <linux/limits.h> #include <linux/list.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/powercap.h> #include <linux/scmi_protocol.h> #include <linux/slab.h> diff --git a/drivers/regulator/scmi-regulator.c b/drivers/regulator/scmi-regulator.c index c005e65ba0ec..f55f228cb133 100644 --- a/drivers/regulator/scmi-regulator.c +++ b/drivers/regulator/scmi-regulator.c @@ -25,6 +25,7 @@ #include <linux/linear_range.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/of.h> #include <linux/regulator/driver.h> #include <linux/regulator/machine.h> diff --git a/drivers/reset/reset-scmi.c b/drivers/reset/reset-scmi.c index 4335811e0cfa..a6739df1d3c2 100644 --- a/drivers/reset/reset-scmi.c +++ b/drivers/reset/reset-scmi.c @@ -6,6 +6,7 @@ */ #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/of.h> #include <linux/device.h> #include <linux/reset-controller.h> diff --git a/drivers/rtc/rtc-imx-sm-bbm.c b/drivers/rtc/rtc-imx-sm-bbm.c index daa472be7c80..c8643718cef1 100644 --- a/drivers/rtc/rtc-imx-sm-bbm.c +++ b/drivers/rtc/rtc-imx-sm-bbm.c @@ -5,6 +5,7 @@ #include <linux/jiffies.h> #include <linux/module.h> +#include <linux/mod_devicetable.h> #include <linux/platform_device.h> #include <linux/rtc.h> #include <linux/scmi_protocol.h> diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 3b0c9a251a2e..769382f2eadd 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -473,6 +473,17 @@ struct rpmsg_device_id { kernel_ulong_t driver_data; }; +/* scmi */ + +#define SCMI_NAME_SIZE 32 +#define SCMI_MODULE_PREFIX "scmi:" + +struct scmi_device_id { + __u8 protocol_id; + char name[SCMI_NAME_SIZE]; + kernel_ulong_t driver_data; +}; + /* i2c */ #define I2C_NAME_SIZE 20 diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index 5ab73b1ab9aa..61f5ecfe0133 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -951,10 +951,7 @@ struct scmi_device { #define to_scmi_dev(d) container_of_const(d, struct scmi_device, dev) -struct scmi_device_id { - u8 protocol_id; - const char *name; -}; +struct scmi_device_id; struct scmi_driver { const char *name; diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c index b4178c42d08f..da5bd712c8da 100644 --- a/scripts/mod/devicetable-offsets.c +++ b/scripts/mod/devicetable-offsets.c @@ -144,6 +144,10 @@ int main(void) DEVID(rpmsg_device_id); DEVID_FIELD(rpmsg_device_id, name); + DEVID(scmi_device_id); + DEVID_FIELD(scmi_device_id, protocol_id); + DEVID_FIELD(scmi_device_id, name); + DEVID(i2c_device_id); DEVID_FIELD(i2c_device_id, name); diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 8d36c74dec2d..a5283f4c8e6f 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -852,6 +852,16 @@ static void do_rpmsg_entry(struct module *mod, void *symval) module_alias_printf(mod, false, RPMSG_DEVICE_MODALIAS_FMT, *name); } +/* Looks like: scmi:NN:S */ +static void do_scmi_entry(struct module *mod, void *symval) +{ + DEF_FIELD(symval, scmi_device_id, protocol_id); + DEF_FIELD_ADDR(symval, scmi_device_id, name); + + module_alias_printf(mod, false, SCMI_MODULE_PREFIX "%02x:%s", + protocol_id, *name); +} + /* Looks like: i2c:S */ static void do_i2c_entry(struct module *mod, void *symval) { @@ -1491,6 +1501,7 @@ static const struct devtable devtable[] = { {"virtio", SIZE_virtio_device_id, do_virtio_entry}, {"vmbus", SIZE_hv_vmbus_device_id, do_vmbus_entry}, {"rpmsg", SIZE_rpmsg_device_id, do_rpmsg_entry}, + {"scmi", SIZE_scmi_device_id, do_scmi_entry}, {"i2c", SIZE_i2c_device_id, do_i2c_entry}, {"i3c", SIZE_i3c_device_id, do_i3c_entry}, {"slim", SIZE_slim_device_id, do_slim_entry}, -- 2.53.0 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 1/2] module: add SCMI device table alias support 2026-06-18 15:56 ` [PATCH v2 1/2] module: add SCMI device table alias support Bjorn Andersson @ 2026-06-18 18:16 ` Frank Li 0 siblings, 0 replies; 15+ messages in thread From: Frank Li @ 2026-06-18 18:16 UTC (permalink / raw) To: Bjorn Andersson Cc: Sudeep Holla, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Hans de Goede, Stephen Boyd, Brian Masney, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc On Thu, Jun 18, 2026 at 03:56:34PM +0000, Bjorn Andersson wrote: > > SCMI client drivers already describe their bus match data with > MODULE_DEVICE_TABLE(scmi, ...), but modpost does not know how to consume > SCMI device tables. As a result, SCMI modules do not get generated module > aliases from their id tables. > > Move struct scmi_device_id to mod_devicetable.h so it has a fixed layout > visible to modpost, add the corresponding generated offsets and teach > file2alias to emit scmi:<protocol>:<name> aliases. > > Use the same stable alias format for SCMI device uevents and sysfs > modaliases. The previous string included the instance-specific device > name, which is not useful for matching modules. > > Assisted-by: Codex:GPT-5.5 > Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> > Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> > --- Reviewed-by: Frank Li <Frank.Li@nxp.com> ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 2/2] firmware: arm_scmi: request modules for discovered protocols 2026-06-18 15:56 [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading Bjorn Andersson 2026-06-18 15:56 ` [PATCH v2 1/2] module: add SCMI device table alias support Bjorn Andersson @ 2026-06-18 15:56 ` Bjorn Andersson 2026-06-18 20:31 ` [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading Hans de Goede 2 siblings, 0 replies; 15+ messages in thread From: Bjorn Andersson @ 2026-06-18 15:56 UTC (permalink / raw) To: Sudeep Holla, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette Cc: arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Hans de Goede, Bjorn Andersson, Stephen Boyd, Brian Masney, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc SCMI client devices are created from SCMI driver id tables. If such a driver is modular, the core does not know the driver's client name until the module has already loaded, so normal device uevent based autoloading cannot break the dependency cycle. Emit a protocol-level alias for each SCMI device id table entry and request that alias when the SCMI core discovers an implemented protocol. This loads modules that have registered interest in the protocol; their normal SCMI driver registration then requests the concrete client device and the SCMI bus matches it by protocol and name. This allows e.g. ARM_SCMI_CPUFREQ=m to autoload on systems that expose only the SCMI Performance protocol node, where the cpufreq client name is Linux-internal and not available from firmware before loading the module. Assisted-by: Codex:GPT-5.5 Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> --- drivers/firmware/arm_scmi/driver.c | 2 ++ include/linux/mod_devicetable.h | 1 + scripts/mod/file2alias.c | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c index 0fd6a947499e..7d33fab94e28 100644 --- a/drivers/firmware/arm_scmi/driver.c +++ b/drivers/firmware/arm_scmi/driver.c @@ -48,6 +48,7 @@ #include <trace/events/scmi.h> #define SCMI_VENDOR_MODULE_ALIAS_FMT "scmi-protocol-0x%02x-%s" +#define SCMI_MODULE_ALIAS_FMT SCMI_PROTOCOL_MODULE_PREFIX "0x%02x" static DEFINE_IDA(scmi_id); @@ -3363,6 +3364,7 @@ static int scmi_probe(struct platform_device *pdev) } of_node_get(child); + request_module_nowait(SCMI_MODULE_ALIAS_FMT, prot_id); scmi_create_protocol_devices(child, info, prot_id, NULL); } diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index 769382f2eadd..2cc7e78e35a3 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -477,6 +477,7 @@ struct rpmsg_device_id { #define SCMI_NAME_SIZE 32 #define SCMI_MODULE_PREFIX "scmi:" +#define SCMI_PROTOCOL_MODULE_PREFIX "scmi-protocol-" struct scmi_device_id { __u8 protocol_id; diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index a5283f4c8e6f..40a37b6bf1ad 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c @@ -852,7 +852,7 @@ static void do_rpmsg_entry(struct module *mod, void *symval) module_alias_printf(mod, false, RPMSG_DEVICE_MODALIAS_FMT, *name); } -/* Looks like: scmi:NN:S */ +/* Looks like: scmi:NN:S and scmi-protocol-0xNN */ static void do_scmi_entry(struct module *mod, void *symval) { DEF_FIELD(symval, scmi_device_id, protocol_id); @@ -860,6 +860,8 @@ static void do_scmi_entry(struct module *mod, void *symval) module_alias_printf(mod, false, SCMI_MODULE_PREFIX "%02x:%s", protocol_id, *name); + module_alias_printf(mod, false, SCMI_PROTOCOL_MODULE_PREFIX "0x%02x", + protocol_id); } /* Looks like: i2c:S */ -- 2.53.0 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-06-18 15:56 [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading Bjorn Andersson 2026-06-18 15:56 ` [PATCH v2 1/2] module: add SCMI device table alias support Bjorn Andersson 2026-06-18 15:56 ` [PATCH v2 2/2] firmware: arm_scmi: request modules for discovered protocols Bjorn Andersson @ 2026-06-18 20:31 ` Hans de Goede 2026-07-09 10:10 ` Sudeep Holla 2 siblings, 1 reply; 15+ messages in thread From: Hans de Goede @ 2026-06-18 20:31 UTC (permalink / raw) To: Bjorn Andersson, Sudeep Holla, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette Cc: arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Brian Masney, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc Hi, On 18-Jun-26 17:56, Bjorn Andersson wrote: > SCMI drivers such as the Arm SCMI CPUfreq driver are allowed to built as > modules, but they are then not automatically loaded. Rework the SCMI > device table alias support to make modpost consume the information from > MODULE_DEVICE_TABLE(scmi, ...) and allow drivers to be loaded based on > this information, if known. Also add a protocol-based alias to also > trigger driver loading when only the SCMI protocol id is known. > > Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> So I just gave this a test spin and unfortunately it does not work. The problem with Fedora's kernel-config / setup is that the request_module() from patch 2/2 runs from the initramfs, but the scmi_cpufreq module is only available in the rootfs. It does work if I explictly add the scmi_cpufreq module to the initramfs, then it does get autoloaded. We really need some place to put a uevent sysfs attr which then gets replayed when udev is restarted from the rootfs and then re-reads all the uevent files as part of its coldplug enumeration. I wonder if it is ok for a single uevent file to have multiple MODALIAS= lines in there. Regards, Hans > --- > Changes in v2: > - Use request_module_nowait() > - Drop #include <linux/mod_devicetable.h> from scmi_protocol.h > - Link to v1: https://patch.msgid.link/20260616-scmi-modalias-v1-0-662b8dd52ab2@oss.qualcomm.com > > To: Sudeep Holla <sudeep.holla@kernel.org> > To: Cristian Marussi <cristian.marussi@arm.com> > To: Michael Turquette <mturquette@baylibre.com> > To: Nicolas Schier <nsc@kernel.org> > Cc: Stephen Boyd <sboyd@kernel.org> > Cc: Brian Masney <bmasney@redhat.com> > Cc: "Rafael J. Wysocki" <rafael@kernel.org> > Cc: Viresh Kumar <viresh.kumar@linaro.org> > Cc: Frank Li <Frank.Li@nxp.com> > Cc: Sascha Hauer <s.hauer@pengutronix.de> > Cc: Pengutronix Kernel Team <kernel@pengutronix.de> > Cc: Fabio Estevam <festevam@gmail.com> > Cc: Guenter Roeck <linux@roeck-us.net> > Cc: Jyoti Bhayana <jbhayana@google.com> > Cc: Jonathan Cameron <jic23@kernel.org> > Cc: David Lechner <dlechner@baylibre.com> > Cc: Nuno Sá <nuno.sa@analog.com> > Cc: Andy Shevchenko <andy@kernel.org> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> > Cc: Ulf Hansson <ulfh@kernel.org> > Cc: Liam Girdwood <lgirdwood@gmail.com> > Cc: Mark Brown <broonie@kernel.org> > Cc: Philipp Zabel <p.zabel@pengutronix.de> > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com> > Cc: Nathan Chancellor <nathan@kernel.org> > Cc: arm-scmi@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-clk@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-pm@vger.kernel.org > Cc: imx@lists.linux.dev > Cc: linux-hwmon@vger.kernel.org > Cc: linux-iio@vger.kernel.org > Cc: linux-input@vger.kernel.org > Cc: linux-rtc@vger.kernel.org > Cc: linux-kbuild@vger.kernel.org > > --- > Bjorn Andersson (2): > module: add SCMI device table alias support > firmware: arm_scmi: request modules for discovered protocols > > drivers/clk/clk-scmi.c | 1 + > drivers/cpufreq/scmi-cpufreq.c | 1 + > drivers/firmware/arm_scmi/bus.c | 20 ++++++++++---------- > drivers/firmware/arm_scmi/driver.c | 3 +++ > drivers/firmware/arm_scmi/scmi_power_control.c | 1 + > drivers/firmware/imx/sm-cpu.c | 1 + > drivers/firmware/imx/sm-lmm.c | 1 + > drivers/firmware/imx/sm-misc.c | 1 + > drivers/hwmon/scmi-hwmon.c | 1 + > drivers/iio/common/scmi_sensors/scmi_iio.c | 1 + > drivers/input/keyboard/imx-sm-bbm-key.c | 1 + > drivers/pmdomain/arm/scmi_perf_domain.c | 1 + > drivers/pmdomain/arm/scmi_pm_domain.c | 1 + > drivers/powercap/arm_scmi_powercap.c | 1 + > drivers/regulator/scmi-regulator.c | 1 + > drivers/reset/reset-scmi.c | 1 + > drivers/rtc/rtc-imx-sm-bbm.c | 1 + > include/linux/mod_devicetable.h | 12 ++++++++++++ > include/linux/scmi_protocol.h | 5 +---- > scripts/mod/devicetable-offsets.c | 4 ++++ > scripts/mod/file2alias.c | 13 +++++++++++++ > 21 files changed, 58 insertions(+), 14 deletions(-) > --- > base-commit: 8d6dbbbe3ba62de0a63e962ee004afb848c8e3ac > change-id: 20260616-scmi-modalias-0f32421bd452 > > Best regards, > -- > Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> > > ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-06-18 20:31 ` [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading Hans de Goede @ 2026-07-09 10:10 ` Sudeep Holla 2026-07-09 13:22 ` Hans de Goede 0 siblings, 1 reply; 15+ messages in thread From: Sudeep Holla @ 2026-07-09 10:10 UTC (permalink / raw) To: Hans de Goede Cc: Bjorn Andersson, Sudeep Holla, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Brian Masney, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc On Thu, Jun 18, 2026 at 10:31:12PM +0200, Hans de Goede wrote: > Hi, > > On 18-Jun-26 17:56, Bjorn Andersson wrote: > > SCMI drivers such as the Arm SCMI CPUfreq driver are allowed to built as > > modules, but they are then not automatically loaded. Rework the SCMI > > device table alias support to make modpost consume the information from > > MODULE_DEVICE_TABLE(scmi, ...) and allow drivers to be loaded based on > > this information, if known. Also add a protocol-based alias to also > > trigger driver loading when only the SCMI protocol id is known. > > > > Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> > > So I just gave this a test spin and unfortunately it does not work. > > The problem with Fedora's kernel-config / setup is that the > request_module() from patch 2/2 runs from the initramfs, but > the scmi_cpufreq module is only available in the rootfs. > > It does work if I explictly add the scmi_cpufreq module to > the initramfs, then it does get autoloaded. > > We really need some place to put a uevent sysfs attr which then > gets replayed when udev is restarted from the rootfs and then > re-reads all the uevent files as part of its coldplug > enumeration. > I don't have much knowledge on uevent to provide any suggestions/help. But isn't this a generic requirement ? I mean you could have modules install on the rootfs and not all of them are packed in initramfs ? Just wondering if that works for other modules, we can examine how do they work and what are we missing ? -- Regards, Sudeep ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-07-09 10:10 ` Sudeep Holla @ 2026-07-09 13:22 ` Hans de Goede 2026-07-09 13:28 ` Brian Masney 0 siblings, 1 reply; 15+ messages in thread From: Hans de Goede @ 2026-07-09 13:22 UTC (permalink / raw) To: Sudeep Holla Cc: Bjorn Andersson, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Brian Masney, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc Hi, On 9-Jul-26 12:10, Sudeep Holla wrote: > On Thu, Jun 18, 2026 at 10:31:12PM +0200, Hans de Goede wrote: >> Hi, >> >> On 18-Jun-26 17:56, Bjorn Andersson wrote: >>> SCMI drivers such as the Arm SCMI CPUfreq driver are allowed to built as >>> modules, but they are then not automatically loaded. Rework the SCMI >>> device table alias support to make modpost consume the information from >>> MODULE_DEVICE_TABLE(scmi, ...) and allow drivers to be loaded based on >>> this information, if known. Also add a protocol-based alias to also >>> trigger driver loading when only the SCMI protocol id is known. >>> >>> Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> >> >> So I just gave this a test spin and unfortunately it does not work. >> >> The problem with Fedora's kernel-config / setup is that the >> request_module() from patch 2/2 runs from the initramfs, but >> the scmi_cpufreq module is only available in the rootfs. >> >> It does work if I explictly add the scmi_cpufreq module to >> the initramfs, then it does get autoloaded. >> >> We really need some place to put a uevent sysfs attr which then >> gets replayed when udev is restarted from the rootfs and then >> re-reads all the uevent files as part of its coldplug >> enumeration. >> > > I don't have much knowledge on uevent to provide any suggestions/help. > But isn't this a generic requirement ? I mean you could have modules > install on the rootfs and not all of them are packed in initramfs ? > Just wondering if that works for other modules, we can examine how > do they work and what are we missing ? scmi is special because the actual devices under /sys/bus/scmi/devices only get created when the module with the driver is loaded because of some funtion/id mapping requiring info from the driver. Patch 2/2 tries to work around this by loading all scmi drivers matching the scmi protocol which is known at bus enumeration time, but this only works if the actual scmi driver is in the initramfs because this done through directly calling modprobe() from the kernel which does not get "replayed" when switching to the real rootfs. And no /sys/bus/scmi/devices/xxx device means no /sys/bus/scmi/devices/xxx/modalias nor /sys/bus/scmi/devices/xxx/uevent which udev uses for coldplug (hotplug event replay) when switching to the real root. The cleanest way to fix this from a how things are supposed to work according to the generic kernel device-model design is to get rid of the creation of the devices being delayed. Which may mean moving some static mapping tables from the driver into the scmi core. I'm not familiar enough with the scmi bus code to be sure. Regards, Hans > ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-07-09 13:22 ` Hans de Goede @ 2026-07-09 13:28 ` Brian Masney 2026-07-09 14:07 ` Hans de Goede 0 siblings, 1 reply; 15+ messages in thread From: Brian Masney @ 2026-07-09 13:28 UTC (permalink / raw) To: Hans de Goede Cc: Sudeep Holla, Bjorn Andersson, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc Hi Hans, On Thu, Jul 09, 2026 at 03:22:29PM +0200, Hans de Goede wrote: > On 9-Jul-26 12:10, Sudeep Holla wrote: > > On Thu, Jun 18, 2026 at 10:31:12PM +0200, Hans de Goede wrote: > >> On 18-Jun-26 17:56, Bjorn Andersson wrote: > >>> SCMI drivers such as the Arm SCMI CPUfreq driver are allowed to built as > >>> modules, but they are then not automatically loaded. Rework the SCMI > >>> device table alias support to make modpost consume the information from > >>> MODULE_DEVICE_TABLE(scmi, ...) and allow drivers to be loaded based on > >>> this information, if known. Also add a protocol-based alias to also > >>> trigger driver loading when only the SCMI protocol id is known. > >>> > >>> Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> > >> > >> So I just gave this a test spin and unfortunately it does not work. > >> > >> The problem with Fedora's kernel-config / setup is that the > >> request_module() from patch 2/2 runs from the initramfs, but > >> the scmi_cpufreq module is only available in the rootfs. > >> > >> It does work if I explictly add the scmi_cpufreq module to > >> the initramfs, then it does get autoloaded. > >> > >> We really need some place to put a uevent sysfs attr which then > >> gets replayed when udev is restarted from the rootfs and then > >> re-reads all the uevent files as part of its coldplug > >> enumeration. > >> > > > > I don't have much knowledge on uevent to provide any suggestions/help. > > But isn't this a generic requirement ? I mean you could have modules > > install on the rootfs and not all of them are packed in initramfs ? > > Just wondering if that works for other modules, we can examine how > > do they work and what are we missing ? > > scmi is special because the actual devices under /sys/bus/scmi/devices > only get created when the module with the driver is loaded because > of some funtion/id mapping requiring info from the driver. > > Patch 2/2 tries to work around this by loading all scmi drivers matching > the scmi protocol which is known at bus enumeration time, but this only > works if the actual scmi driver is in the initramfs because this done > through directly calling modprobe() from the kernel which does not > get "replayed" when switching to the real rootfs. Should the SCMI drivers be added to the dracut module here? https://github.com/dracut-ng/dracut/blob/main/modules.d/70kernel-modules/module-setup.sh#L73 A few years ago we had to add the interconnect drivers to the list for Fedora. Brian ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-07-09 13:28 ` Brian Masney @ 2026-07-09 14:07 ` Hans de Goede 2026-07-09 14:21 ` Sudeep Holla 0 siblings, 1 reply; 15+ messages in thread From: Hans de Goede @ 2026-07-09 14:07 UTC (permalink / raw) To: Brian Masney Cc: Sudeep Holla, Bjorn Andersson, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc Hi Brian, On 9-Jul-26 15:28, Brian Masney wrote: > Hi Hans, > > On Thu, Jul 09, 2026 at 03:22:29PM +0200, Hans de Goede wrote: >> On 9-Jul-26 12:10, Sudeep Holla wrote: >>> On Thu, Jun 18, 2026 at 10:31:12PM +0200, Hans de Goede wrote: >>>> On 18-Jun-26 17:56, Bjorn Andersson wrote: >>>>> SCMI drivers such as the Arm SCMI CPUfreq driver are allowed to built as >>>>> modules, but they are then not automatically loaded. Rework the SCMI >>>>> device table alias support to make modpost consume the information from >>>>> MODULE_DEVICE_TABLE(scmi, ...) and allow drivers to be loaded based on >>>>> this information, if known. Also add a protocol-based alias to also >>>>> trigger driver loading when only the SCMI protocol id is known. >>>>> >>>>> Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> >>>> >>>> So I just gave this a test spin and unfortunately it does not work. >>>> >>>> The problem with Fedora's kernel-config / setup is that the >>>> request_module() from patch 2/2 runs from the initramfs, but >>>> the scmi_cpufreq module is only available in the rootfs. >>>> >>>> It does work if I explictly add the scmi_cpufreq module to >>>> the initramfs, then it does get autoloaded. >>>> >>>> We really need some place to put a uevent sysfs attr which then >>>> gets replayed when udev is restarted from the rootfs and then >>>> re-reads all the uevent files as part of its coldplug >>>> enumeration. >>>> >>> >>> I don't have much knowledge on uevent to provide any suggestions/help. >>> But isn't this a generic requirement ? I mean you could have modules >>> install on the rootfs and not all of them are packed in initramfs ? >>> Just wondering if that works for other modules, we can examine how >>> do they work and what are we missing ? >> >> scmi is special because the actual devices under /sys/bus/scmi/devices >> only get created when the module with the driver is loaded because >> of some funtion/id mapping requiring info from the driver. >> >> Patch 2/2 tries to work around this by loading all scmi drivers matching >> the scmi protocol which is known at bus enumeration time, but this only >> works if the actual scmi driver is in the initramfs because this done >> through directly calling modprobe() from the kernel which does not >> get "replayed" when switching to the real rootfs. > > Should the SCMI drivers be added to the dracut module here? > > https://github.com/dracut-ng/dracut/blob/main/modules.d/70kernel-modules/module-setup.sh#L73 > > A few years ago we had to add the interconnect drivers to the list for > Fedora. That would be one solution. I first want to understand the problem better though. The scmi bus not creating the devices until the kmod with the driver has loaded is weird. I wonder if we can just move a small part of the drivers (some mapping table) into the bus code and then just have this work as it does on regular busses. I hope to be able to make some time to look into this soonish. Regards, Hans ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-07-09 14:07 ` Hans de Goede @ 2026-07-09 14:21 ` Sudeep Holla 2026-07-09 14:31 ` Hans de Goede 0 siblings, 1 reply; 15+ messages in thread From: Sudeep Holla @ 2026-07-09 14:21 UTC (permalink / raw) To: Hans de Goede Cc: Brian Masney, Bjorn Andersson, Sudeep Holla, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc On Thu, Jul 09, 2026 at 04:07:17PM +0200, Hans de Goede wrote: > Hi Brian, > > On 9-Jul-26 15:28, Brian Masney wrote: > > Hi Hans, > > > > On Thu, Jul 09, 2026 at 03:22:29PM +0200, Hans de Goede wrote: > >> On 9-Jul-26 12:10, Sudeep Holla wrote: > >>> On Thu, Jun 18, 2026 at 10:31:12PM +0200, Hans de Goede wrote: > >>>> On 18-Jun-26 17:56, Bjorn Andersson wrote: > >>>>> SCMI drivers such as the Arm SCMI CPUfreq driver are allowed to built as > >>>>> modules, but they are then not automatically loaded. Rework the SCMI > >>>>> device table alias support to make modpost consume the information from > >>>>> MODULE_DEVICE_TABLE(scmi, ...) and allow drivers to be loaded based on > >>>>> this information, if known. Also add a protocol-based alias to also > >>>>> trigger driver loading when only the SCMI protocol id is known. > >>>>> > >>>>> Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> > >>>> > >>>> So I just gave this a test spin and unfortunately it does not work. > >>>> > >>>> The problem with Fedora's kernel-config / setup is that the > >>>> request_module() from patch 2/2 runs from the initramfs, but > >>>> the scmi_cpufreq module is only available in the rootfs. > >>>> > >>>> It does work if I explictly add the scmi_cpufreq module to > >>>> the initramfs, then it does get autoloaded. > >>>> > >>>> We really need some place to put a uevent sysfs attr which then > >>>> gets replayed when udev is restarted from the rootfs and then > >>>> re-reads all the uevent files as part of its coldplug > >>>> enumeration. > >>>> > >>> > >>> I don't have much knowledge on uevent to provide any suggestions/help. > >>> But isn't this a generic requirement ? I mean you could have modules > >>> install on the rootfs and not all of them are packed in initramfs ? > >>> Just wondering if that works for other modules, we can examine how > >>> do they work and what are we missing ? > >> > >> scmi is special because the actual devices under /sys/bus/scmi/devices > >> only get created when the module with the driver is loaded because > >> of some funtion/id mapping requiring info from the driver. > >> > >> Patch 2/2 tries to work around this by loading all scmi drivers matching > >> the scmi protocol which is known at bus enumeration time, but this only > >> works if the actual scmi driver is in the initramfs because this done > >> through directly calling modprobe() from the kernel which does not > >> get "replayed" when switching to the real rootfs. > > > > Should the SCMI drivers be added to the dracut module here? > > > > https://github.com/dracut-ng/dracut/blob/main/modules.d/70kernel-modules/module-setup.sh#L73 > > > > A few years ago we had to add the interconnect drivers to the list for > > Fedora. > > That would be one solution. I first want to understand the problem better > though. The scmi bus not creating the devices until the kmod with the driver > has loaded is weird. I need to recall why we moved from static list of devices to dynamic. One reason I can think right now is the vendor protocols and their drivers But in general it was an attempt to help multiple drivers bind to different scmi_devices that have same protocol ID. E.g. the performance protocol can be used by cpufreq and devfreq/performance genpd drivers. > I wonder if we can just move a small part of the drivers > (some mapping table) into the bus code and then just have this work as it > does on regular busses. I hope to be able to make some time to look into > this soonish. > I started with that few years ago and we then moved to this dynamic device creation. But I agree if it is deviation from the norms(which I wasn't aware of at the time), we can remove it. -- Regards, Sudeep ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-07-09 14:21 ` Sudeep Holla @ 2026-07-09 14:31 ` Hans de Goede 2026-07-09 14:37 ` Sudeep Holla 0 siblings, 1 reply; 15+ messages in thread From: Hans de Goede @ 2026-07-09 14:31 UTC (permalink / raw) To: Sudeep Holla Cc: Brian Masney, Bjorn Andersson, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc Hi, On 9-Jul-26 16:21, Sudeep Holla wrote: > On Thu, Jul 09, 2026 at 04:07:17PM +0200, Hans de Goede wrote: >> Hi Brian, >> >> On 9-Jul-26 15:28, Brian Masney wrote: >>> Hi Hans, >>> >>> On Thu, Jul 09, 2026 at 03:22:29PM +0200, Hans de Goede wrote: >>>> On 9-Jul-26 12:10, Sudeep Holla wrote: >>>>> On Thu, Jun 18, 2026 at 10:31:12PM +0200, Hans de Goede wrote: >>>>>> On 18-Jun-26 17:56, Bjorn Andersson wrote: >>>>>>> SCMI drivers such as the Arm SCMI CPUfreq driver are allowed to built as >>>>>>> modules, but they are then not automatically loaded. Rework the SCMI >>>>>>> device table alias support to make modpost consume the information from >>>>>>> MODULE_DEVICE_TABLE(scmi, ...) and allow drivers to be loaded based on >>>>>>> this information, if known. Also add a protocol-based alias to also >>>>>>> trigger driver loading when only the SCMI protocol id is known. >>>>>>> >>>>>>> Signed-off-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com> >>>>>> >>>>>> So I just gave this a test spin and unfortunately it does not work. >>>>>> >>>>>> The problem with Fedora's kernel-config / setup is that the >>>>>> request_module() from patch 2/2 runs from the initramfs, but >>>>>> the scmi_cpufreq module is only available in the rootfs. >>>>>> >>>>>> It does work if I explictly add the scmi_cpufreq module to >>>>>> the initramfs, then it does get autoloaded. >>>>>> >>>>>> We really need some place to put a uevent sysfs attr which then >>>>>> gets replayed when udev is restarted from the rootfs and then >>>>>> re-reads all the uevent files as part of its coldplug >>>>>> enumeration. >>>>>> >>>>> >>>>> I don't have much knowledge on uevent to provide any suggestions/help. >>>>> But isn't this a generic requirement ? I mean you could have modules >>>>> install on the rootfs and not all of them are packed in initramfs ? >>>>> Just wondering if that works for other modules, we can examine how >>>>> do they work and what are we missing ? >>>> >>>> scmi is special because the actual devices under /sys/bus/scmi/devices >>>> only get created when the module with the driver is loaded because >>>> of some funtion/id mapping requiring info from the driver. >>>> >>>> Patch 2/2 tries to work around this by loading all scmi drivers matching >>>> the scmi protocol which is known at bus enumeration time, but this only >>>> works if the actual scmi driver is in the initramfs because this done >>>> through directly calling modprobe() from the kernel which does not >>>> get "replayed" when switching to the real rootfs. >>> >>> Should the SCMI drivers be added to the dracut module here? >>> >>> https://github.com/dracut-ng/dracut/blob/main/modules.d/70kernel-modules/module-setup.sh#L73 >>> >>> A few years ago we had to add the interconnect drivers to the list for >>> Fedora. >> >> That would be one solution. I first want to understand the problem better >> though. The scmi bus not creating the devices until the kmod with the driver >> has loaded is weird. > > I need to recall why we moved from static list of devices to dynamic. > One reason I can think right now is the vendor protocols and their drivers > But in general it was an attempt to help multiple drivers bind to different > scmi_devices that have same protocol ID. E.g. the performance protocol > can be used by cpufreq and devfreq/performance genpd drivers. Note it is ok to have multiple drivers bind to the same modalias, depending on the reason why there are multiple drivers either one should detect that it is not compatible and exit probe() with -ENODEV or there should be some other mechanism to make sure only one driver loads. E.g. duplicate USB device-ids happen (they shouldn't but they do) and then the drivers typically figure out if they are talking to the device which they were written for, or the other device with the same USB-ids and then one of the 2 drivers exits with -ENODEV. >> I wonder if we can just move a small part of the drivers >> (some mapping table) into the bus code and then just have this work as it >> does on regular busses. I hope to be able to make some time to look into >> this soonish. >> > > I started with that few years ago and we then moved to this dynamic > device creation. But I agree if it is deviation from the norms(which I > wasn't aware of at the time), we can remove it. Looking at the issue this is causing for automatic module loading if we can get back to the bus enumeration code always creating a device without waiting for the driver kmod to load then that would be good IMHO. Regards, Hans ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-07-09 14:31 ` Hans de Goede @ 2026-07-09 14:37 ` Sudeep Holla 2026-07-09 14:49 ` Hans de Goede 2026-07-09 15:49 ` Cristian Marussi 0 siblings, 2 replies; 15+ messages in thread From: Sudeep Holla @ 2026-07-09 14:37 UTC (permalink / raw) To: Hans de Goede Cc: Brian Masney, Bjorn Andersson, Sudeep Holla, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc On Thu, Jul 09, 2026 at 04:31:00PM +0200, Hans de Goede wrote: > Hi, > > On 9-Jul-26 16:21, Sudeep Holla wrote: [...] > > > > I need to recall why we moved from static list of devices to dynamic. > > One reason I can think right now is the vendor protocols and their drivers > > But in general it was an attempt to help multiple drivers bind to different > > scmi_devices that have same protocol ID. E.g. the performance protocol > > can be used by cpufreq and devfreq/performance genpd drivers. > > Note it is ok to have multiple drivers bind to the same modalias, > depending on the reason why there are multiple drivers either one > should detect that it is not compatible and exit probe() with -ENODEV > or there should be some other mechanism to make sure only one driver > loads. > > E.g. duplicate USB device-ids happen (they shouldn't but they do) and > then the drivers typically figure out if they are talking to the device > which they were written for, or the other device with the same USB-ids > and then one of the 2 drivers exits with -ENODEV. > Understood. Sorry I tried to explain with examples assuming you may not be aware of the details, but now reading your response, you have better examples. > >> I wonder if we can just move a small part of the drivers > >> (some mapping table) into the bus code and then just have this work as it > >> does on regular busses. I hope to be able to make some time to look into > >> this soonish. > >> > > > > I started with that few years ago and we then moved to this dynamic > > device creation. But I agree if it is deviation from the norms(which I > > wasn't aware of at the time), we can remove it. > > Looking at the issue this is causing for automatic module loading if we > can get back to the bus enumeration code always creating a device without > waiting for the driver kmod to load then that would be good IMHO. > Sure if it fixes the issue for you. Cristian can point out anything I might have missed to consider as he is the one who reworked it and made it dynamic device creation which at the time sounded nice option to solve the issue. We weren't aware that it could cause such issues 🙁. -- Regards, Sudeep ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-07-09 14:37 ` Sudeep Holla @ 2026-07-09 14:49 ` Hans de Goede 2026-07-09 15:54 ` Sudeep Holla 2026-07-09 15:49 ` Cristian Marussi 1 sibling, 1 reply; 15+ messages in thread From: Hans de Goede @ 2026-07-09 14:49 UTC (permalink / raw) To: Sudeep Holla Cc: Brian Masney, Bjorn Andersson, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc Hi, On 9-Jul-26 16:37, Sudeep Holla wrote: > On Thu, Jul 09, 2026 at 04:31:00PM +0200, Hans de Goede wrote: >> Hi, >> >> On 9-Jul-26 16:21, Sudeep Holla wrote: > [...] >>> >>> I need to recall why we moved from static list of devices to dynamic. >>> One reason I can think right now is the vendor protocols and their drivers >>> But in general it was an attempt to help multiple drivers bind to different >>> scmi_devices that have same protocol ID. E.g. the performance protocol >>> can be used by cpufreq and devfreq/performance genpd drivers. >> >> Note it is ok to have multiple drivers bind to the same modalias, >> depending on the reason why there are multiple drivers either one >> should detect that it is not compatible and exit probe() with -ENODEV >> or there should be some other mechanism to make sure only one driver >> loads. >> >> E.g. duplicate USB device-ids happen (they shouldn't but they do) and >> then the drivers typically figure out if they are talking to the device >> which they were written for, or the other device with the same USB-ids >> and then one of the 2 drivers exits with -ENODEV. >> > > Understood. Sorry I tried to explain with examples assuming you may not > be aware of the details, but now reading your response, you have better > examples. > >>>> I wonder if we can just move a small part of the drivers >>>> (some mapping table) into the bus code and then just have this work as it >>>> does on regular busses. I hope to be able to make some time to look into >>>> this soonish. >>>> >>> >>> I started with that few years ago and we then moved to this dynamic >>> device creation. But I agree if it is deviation from the norms(which I >>> wasn't aware of at the time), we can remove it. >> >> Looking at the issue this is causing for automatic module loading if we >> can get back to the bus enumeration code always creating a device without >> waiting for the driver kmod to load then that would be good IMHO. >> > > Sure if it fixes the issue for you. Cristian can point out anything I > might have missed to consider as he is the one who reworked it and made > it dynamic device creation which at the time sounded nice option to > solve the issue. We weren't aware that it could cause such issues 🙁. Note that before patch 1/2 of this series we did not have working module-autoloading for SCMI modules at all. With that said yes it would be nice to get this working. Can you provide a patch for this to try ? Regards, Hans ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-07-09 14:49 ` Hans de Goede @ 2026-07-09 15:54 ` Sudeep Holla 0 siblings, 0 replies; 15+ messages in thread From: Sudeep Holla @ 2026-07-09 15:54 UTC (permalink / raw) To: Hans de Goede Cc: Brian Masney, Bjorn Andersson, Cristian Marussi, Sudeep Holla, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc On Thu, Jul 09, 2026 at 04:49:18PM +0200, Hans de Goede wrote: > Hi, > > On 9-Jul-26 16:37, Sudeep Holla wrote: > > On Thu, Jul 09, 2026 at 04:31:00PM +0200, Hans de Goede wrote: > >> Hi, > >> > >> On 9-Jul-26 16:21, Sudeep Holla wrote: > > [...] > >>> > >>> I need to recall why we moved from static list of devices to dynamic. > >>> One reason I can think right now is the vendor protocols and their drivers > >>> But in general it was an attempt to help multiple drivers bind to different > >>> scmi_devices that have same protocol ID. E.g. the performance protocol > >>> can be used by cpufreq and devfreq/performance genpd drivers. > >> > >> Note it is ok to have multiple drivers bind to the same modalias, > >> depending on the reason why there are multiple drivers either one > >> should detect that it is not compatible and exit probe() with -ENODEV > >> or there should be some other mechanism to make sure only one driver > >> loads. > >> > >> E.g. duplicate USB device-ids happen (they shouldn't but they do) and > >> then the drivers typically figure out if they are talking to the device > >> which they were written for, or the other device with the same USB-ids > >> and then one of the 2 drivers exits with -ENODEV. > >> > > > > Understood. Sorry I tried to explain with examples assuming you may not > > be aware of the details, but now reading your response, you have better > > examples. > > > >>>> I wonder if we can just move a small part of the drivers > >>>> (some mapping table) into the bus code and then just have this work as it > >>>> does on regular busses. I hope to be able to make some time to look into > >>>> this soonish. > >>>> > >>> > >>> I started with that few years ago and we then moved to this dynamic > >>> device creation. But I agree if it is deviation from the norms(which I > >>> wasn't aware of at the time), we can remove it. > >> > >> Looking at the issue this is causing for automatic module loading if we > >> can get back to the bus enumeration code always creating a device without > >> waiting for the driver kmod to load then that would be good IMHO. > >> > > > > Sure if it fixes the issue for you. Cristian can point out anything I > > might have missed to consider as he is the one who reworked it and made > > it dynamic device creation which at the time sounded nice option to > > solve the issue. We weren't aware that it could cause such issues 🙁. > > Note that before patch 1/2 of this series we did not have working > module-autoloading for SCMI modules at all. With that said yes it would > be nice to get this working. > > Can you provide a patch for this to try ? > Not sure what exactly are you asking, but I don't have anything w.r.t the discussion handy to share. The codebase has moved a lot to revert just the dynamic creation addition patch unfortunately. -- Regards, Sudeep ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading 2026-07-09 14:37 ` Sudeep Holla 2026-07-09 14:49 ` Hans de Goede @ 2026-07-09 15:49 ` Cristian Marussi 1 sibling, 0 replies; 15+ messages in thread From: Cristian Marussi @ 2026-07-09 15:49 UTC (permalink / raw) To: Sudeep Holla Cc: Hans de Goede, Brian Masney, Bjorn Andersson, Cristian Marussi, Nathan Chancellor, Nicolas Schier, Michael Turquette, arm-scmi, linux-arm-kernel, linux-kernel, linux-kbuild, Stephen Boyd, Rafael J. Wysocki, Viresh Kumar, Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, Guenter Roeck, Jyoti Bhayana, Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko, Dmitry Torokhov, Ulf Hansson, Liam Girdwood, Mark Brown, Philipp Zabel, Alexandre Belloni, linux-clk, linux-pm, imx, linux-hwmon, linux-iio, linux-input, linux-rtc On Thu, Jul 09, 2026 at 03:37:33PM +0100, Sudeep Holla wrote: > On Thu, Jul 09, 2026 at 04:31:00PM +0200, Hans de Goede wrote: > > Hi, > > > > On 9-Jul-26 16:21, Sudeep Holla wrote: > [...] > > > > > > I need to recall why we moved from static list of devices to dynamic. > > > One reason I can think right now is the vendor protocols and their drivers > > > But in general it was an attempt to help multiple drivers bind to different > > > scmi_devices that have same protocol ID. E.g. the performance protocol > > > can be used by cpufreq and devfreq/performance genpd drivers. > > > > Note it is ok to have multiple drivers bind to the same modalias, > > depending on the reason why there are multiple drivers either one > > should detect that it is not compatible and exit probe() with -ENODEV > > or there should be some other mechanism to make sure only one driver > > loads. > > > > E.g. duplicate USB device-ids happen (they shouldn't but they do) and > > then the drivers typically figure out if they are talking to the device > > which they were written for, or the other device with the same USB-ids > > and then one of the 2 drivers exits with -ENODEV. > > > > Understood. Sorry I tried to explain with examples assuming you may not > be aware of the details, but now reading your response, you have better > examples. > > > >> I wonder if we can just move a small part of the drivers > > >> (some mapping table) into the bus code and then just have this work as it > > >> does on regular busses. I hope to be able to make some time to look into > > >> this soonish. > > >> > > > > > > I started with that few years ago and we then moved to this dynamic > > > device creation. But I agree if it is deviation from the norms(which I > > > wasn't aware of at the time), we can remove it. > > > > Looking at the issue this is causing for automatic module loading if we > > can get back to the bus enumeration code always creating a device without > > waiting for the driver kmod to load then that would be good IMHO. > > > > Sure if it fixes the issue for you. Cristian can point out anything I > might have missed to consider as he is the one who reworked it and made > it dynamic device creation which at the time sounded nice option to > solve the issue. We weren't aware that it could cause such issues 🙁. > The reason for the awkward mechanism of dynamic device creation AFAICR was an explicit request by Qualcomm (via its Linaro landing team at that time) for the generic vendor module suppport that I was adding to be fully self-contained: so that you can write your own protocol and add the DT node and that's it, without the need to patch some centrally maintained table in the core SCMI stack to add your new vendor protocol. Not saying that it was necesarily a good idea to allow that, but that was the origin of this....as far as I can remember....together with the fact that the internal interfaces were reworked to be absolutely the same for standard protocols and vendor protocols... I thought that the current situation was that auto-loading was working for vendor protocols (this autoload issue appeared at first for vendors protocols one year ago) then I had made this hacky attempt to make it work for standard protocols by forcibly emitting a uevent for all known standard protos: https://lore.kernel.org/arm-scmi/20250203100154.140877-2-cristian.marussi@arm.com/ ...but that was clearly not the proper way..and all the rework was dropped... Thanks, Cristian ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-07-09 15:55 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-06-18 15:56 [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading Bjorn Andersson 2026-06-18 15:56 ` [PATCH v2 1/2] module: add SCMI device table alias support Bjorn Andersson 2026-06-18 18:16 ` Frank Li 2026-06-18 15:56 ` [PATCH v2 2/2] firmware: arm_scmi: request modules for discovered protocols Bjorn Andersson 2026-06-18 20:31 ` [PATCH v2 0/2] firmware: arm_scmi: Ensure automatic module loading Hans de Goede 2026-07-09 10:10 ` Sudeep Holla 2026-07-09 13:22 ` Hans de Goede 2026-07-09 13:28 ` Brian Masney 2026-07-09 14:07 ` Hans de Goede 2026-07-09 14:21 ` Sudeep Holla 2026-07-09 14:31 ` Hans de Goede 2026-07-09 14:37 ` Sudeep Holla 2026-07-09 14:49 ` Hans de Goede 2026-07-09 15:54 ` Sudeep Holla 2026-07-09 15:49 ` Cristian Marussi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox