Re: [PATCH v7 1/2] module: add SCMI device table alias support

From: Rob Clark

Date: Fri Sep 18 2026 - 10:52:41 EST


On Fri, Sep 18, 2026 at 7:10 AM Sudeep Holla <sudeep.holla@xxxxxxxxxx> wrote:
>
> On Fri, Sep 18, 2026 at 12:13:10PM +0200, Daniel Lezcano wrote:
> > On 9/18/26 12:02, Hans de Goede wrote:
> > > Hi Daniel,
> > >
> > > On 18-Sep-26 11:53, Daniel Lezcano wrote:
> > > >
> > > > Hi Hans,
> > > >
> > > > thanks for taking care of that
> > > >
> > > >
> > > > On 9/18/26 11:29, Hans de Goede wrote:
> > > > > From: Bjorn Andersson <bjorn.andersson@xxxxxxxxxxxxxxxx>
> > > > >
> > > > > 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@xxxxxxxxxxxxxxxx>
> > > > > Tested-by: Hans de Goede <johannes.goede@xxxxxxxxxxxxxxxx>
> > > > > Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxxxxxxxx>
> > > > > Signed-off-by: Hans de Goede <johannes.goede@xxxxxxxxxxxxxxxx>
> > > > > ---
> > > >
> >
> > [ ... ]
> >
> > > > > #include <linux/bitfield.h>
> > > > > +#include <linux/device-id/scmi.h>
> > > > > #include <linux/device.h>
> > > > > #include <linux/notifier.h>
> > > > > #include <linux/types.h>
> > > > > @@ -951,11 +952,6 @@ 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;
> > > > > -};
> > > > > -
> > > >
> > > > What is the reason of converting the char * to a fixed array? That limits the name and may result in truncation and potentially name collision, no ?
> > >
> > > Because of how modpost works to generate modaliases inside the .ko
> > > any string buffers in device_id structs need to have a fixed length.
> > >
> > > So the truncation / name collision issue pretty much applies to all
> > > foo_device_id structs in the kernel. People should now to make sure
> > > that any strings used will fit inside the fixed string. And I would
> > > expect the compiler to warn for overly long strings.
> > Ok, thanks for the clarification
>
> Not related to above topic, but just wanted to check with Daniel if this
> solves module auto-loading for you. Was there someone else who was testing
> this series and was having issue with earlier versions or its you only
> Hans de Goede and it was with v1/v2 when Bjorn posted them. I remember
> something vaguely and couldn't trace back all the versions easily.

I'm using v7 on glymur slim7x, and it solves the scmi-cpufreq autoloading

Tested-by: Rob Clark <rob.clark@xxxxxxxxxxxxxxxx>