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

From: Uwe Kleine-König

Date: Sun Sep 20 2026 - 06:19:04 EST


On Sun, Sep 20, 2026 at 08:36:10AM +0100, Sudeep Holla wrote:
> On Fri, Sep 18, 2026 at 10:39:46PM +0200, Uwe Kleine-König wrote:
> > On Fri, Sep 18, 2026 at 04:09:36PM +0200, Hans de Goede wrote:
> > > Hi Sudeep,
> > >
> > > On 18-Sep-26 15:32, Sudeep Holla wrote:
> > >
> > > [...]
> > >
> > > >> diff --git a/include/linux/device-id/scmi.h b/include/linux/device-id/scmi.h
> > > >> new file mode 100644
> > > >> index 000000000000..1b4ccfa9dcc5
> > > >> --- /dev/null
> > > >> +++ b/include/linux/device-id/scmi.h
> > > >> @@ -0,0 +1,17 @@
> > > >> +/* SPDX-License-Identifier: GPL-2.0-only */
> > > >> +#ifndef LINUX_DEVICE_ID_SCMI_H
> > > >> +#define LINUX_DEVICE_ID_SCMI_H
> > > >> +
> > > >> +#ifdef __KERNEL__
> > > >> +#include <linux/types.h>
> > > >> +#endif
> > > >> +
> > > >> +#define SCMI_NAME_SIZE 32
> > > >> +#define SCMI_MODULE_PREFIX "scmi:"
> > > >> +
> > > >> +struct scmi_device_id {
> > > >> + __u8 protocol_id;
> > > >> + char name[SCMI_NAME_SIZE];
> > > >> +};
> > > >> +
> > > >> +#endif /* ifndef LINUX_DEVICE_ID_SCMI_H */
> > > >
> > > > You need to include this above file in include/linux/mod_devicetable.h
> > > > to avoid duplication of its inclusion elsewhere. That's the pattern followed
> > > > I see.
> > >
> > > That is what I did for v3, but Uwe, who is leading the splitting
> > > of mod_devicetable.h from one large monster include to smaller
> > > per subsystem/bus includes explicitly requested me to follow this
> > > pattern, see:
> > >
> > > https://lore.kernel.org/arm-scmi/aow2GFAfy84k-N2B@monoceros/
> > >
> > > [...]
> > >
> > > >> diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
> > > >> index b4178c42d08f..91ec3704ee2b 100644
> > > >> --- a/scripts/mod/devicetable-offsets.c
> > > >> +++ b/scripts/mod/devicetable-offsets.c
> > > >> @@ -1,5 +1,6 @@
> > > >> // SPDX-License-Identifier: GPL-2.0
> > > >> #define COMPILE_OFFSETS
> > > >> +#include <linux/device-id/scmi.h>
> > > >
> > > > Drop this for above mentioned reason.
> > >
> > > This was explictly added at request of Uwe because the goal is to
> > > get rid of mod_devicetable.h including all the device-id headers
> > > in a big single catch-all include. This is done because currently
> > > many files include mod_devicetable.h and then if any of the device-id
> > > headers changes everything needs to be rebuild, making incremental
> > > kernel builds much slower.
> > >
> > > (and the same for the second include you point out)
> >
> > FTR: That all sounds right.
> >
> > Let's not add the the dependency mess that is mod_devicetable.h.
> >
>
> I am confused. I am asking to align with what's done in
> Commit ad428f5811bd ("mod_devicetable.h: Split into per subsystem headers")
> and you are disagreeing with that ?
>
> I am not comfortable taking this patch unless there are other similar
> examples that are agreed upon to break the pattern followed in the above
> mentioned commit.
>
> Uwe, please suggest.

I didn't start removing stuff from mod_devicetable.h yet, as changes
there are expensive (regarding build dependencies). So the plan is to
stop drivers consuming mod_devicetable.h and then drop it. (Not sure
this is sensible as new users come in faster than I can fight them, but
I didn't give up yet.)

So while adding new device_id structures to mod_devicetable.h is
consistent with the existing practise, it still makes the situation
worse, as every consumer of mod_devicetable.h then also depends on the
new header for the new structure. That's why I think it's a good idea to
deviate here, even if you're the first one doing so, to not worsen the
already bad situation.

If it helps you, I can propose a patch changing modpost to not use that
catch-(nearly)-all header and use the needed linux/device-id/*.h
instead. I put this on my list for tomorrow.

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature