public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] mcb: Add modpost support for processing MODULE_DEVICE_TABLE
@ 2025-12-01 16:07 Jose Javier Rodriguez Barbarin
  2025-12-01 16:07 ` [PATCH v2 1/1] mcb: Add missing modpost build support Jose Javier Rodriguez Barbarin
  2025-12-01 18:04 ` [PATCH v2 0/1] mcb: Add modpost support for processing MODULE_DEVICE_TABLE Andy Shevchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Jose Javier Rodriguez Barbarin @ 2025-12-01 16:07 UTC (permalink / raw)
  To: andy, krzk, linus.walleij, nathan, nsc, gregkh, bleung,
	heikki.krogerus, abhishekpandit, masahiroy, legion, hughd
  Cc: linux-kbuild, linux-kernel, Jose Javier Rodriguez Barbarin

During the process of update of one of the device drivers that are part of
mcb bus (gpio-menz127.c), Krzysztof from GPIO subsystem asked me
why I was adding new MODULE_ALIAS when I also added the same new
information on MODULE_DEVICE_TABLE.

You can find the messages here:

https://lore.kernel.org/linux-gpio/80a20b13-7c6a-4483-9741-568424f957ef@kernel.org/

After a deeper analysis, I came across that the mcb_table_id defined inside
MODULE_DEVICE_TABLE on all device drivers was being ignored as modpost was
not processing the mcb MODULE_DEVICE_TABLE entries. For this reason, former
contributors were using MODULE_ALIAS for enabling mcb to autoload the
device drivers.

My proposal with these changes is to complete the mcb bus by adding
modpost support for processing mcb MODULE_DEVICE_TABLE.

Once this patch is merged, I will send patches one by one for removing
MODULE_ALIAS from all device drivers as they are no longer needed
(as Andy Shevchenko suggested in v1 review).

---
Changes in v2:

- Place "mcb" before "mei" to follow the order.
- Send changes for mcb drivers in a per-driver basis.

Jose Javier Rodriguez Barbarin (1):
  mcb: Add missing modpost build support

 scripts/mod/devicetable-offsets.c | 3 +++
 scripts/mod/file2alias.c          | 9 +++++++++
 2 files changed, 12 insertions(+)

-- 
2.51.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/1] mcb: Add missing modpost build support
  2025-12-01 16:07 [PATCH v2 0/1] mcb: Add modpost support for processing MODULE_DEVICE_TABLE Jose Javier Rodriguez Barbarin
@ 2025-12-01 16:07 ` Jose Javier Rodriguez Barbarin
  2025-12-01 18:02   ` Andy Shevchenko
  2025-12-01 18:04 ` [PATCH v2 0/1] mcb: Add modpost support for processing MODULE_DEVICE_TABLE Andy Shevchenko
  1 sibling, 1 reply; 5+ messages in thread
From: Jose Javier Rodriguez Barbarin @ 2025-12-01 16:07 UTC (permalink / raw)
  To: andy, krzk, linus.walleij, nathan, nsc, gregkh, bleung,
	heikki.krogerus, abhishekpandit, masahiroy, legion, hughd
  Cc: linux-kbuild, linux-kernel, Jose Javier Rodriguez Barbarin,
	Jorge Sanjuan Garcia

mcb bus is not prepared to autoload client drivers with the data defined on
the drivers' MODULE_DEVICE_TABLE. modpost cannot access to mcb_table_id
inside MODULE_DEVICE_TABLE so the data declared inside is ignored.

Add modpost build support for accessing to the mcb_table_id coded on device
drivers' MODULE_DEVICE_TABLE.

Reviewed-by: Jorge Sanjuan Garcia <dev-jorge.sanjuangarcia@duagon.com>
Signed-off-by: Jose Javier Rodriguez Barbarin <dev-josejavier.rodriguez@duagon.com>
---
 scripts/mod/devicetable-offsets.c | 3 +++
 scripts/mod/file2alias.c          | 9 +++++++++
 2 files changed, 12 insertions(+)

diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index d3d00e85edf7..0470ba7c796d 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -198,6 +198,9 @@ int main(void)
 	DEVID(cpu_feature);
 	DEVID_FIELD(cpu_feature, feature);
 
+	DEVID(mcb_device_id);
+	DEVID_FIELD(mcb_device_id, device);
+
 	DEVID(mei_cl_device_id);
 	DEVID_FIELD(mei_cl_device_id, name);
 	DEVID_FIELD(mei_cl_device_id, uuid);
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index b3333560b95e..4e99393a35f1 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1110,6 +1110,14 @@ static void do_cpu_entry(struct module *mod, void *symval)
 	module_alias_printf(mod, false, "cpu:type:*:feature:*%04X*", feature);
 }
 
+/* Looks like: mcb:16zN */
+static void do_mcb_entry(struct module *mod, void *symval)
+{
+	DEF_FIELD(symval, mcb_device_id, device);
+
+	module_alias_printf(mod, false, "mcb:16z%03d", device);
+}
+
 /* Looks like: mei:S:uuid:N:* */
 static void do_mei_entry(struct module *mod, void *symval)
 {
@@ -1444,6 +1452,7 @@ static const struct devtable devtable[] = {
 	{"mipscdmm", SIZE_mips_cdmm_device_id, do_mips_cdmm_entry},
 	{"x86cpu", SIZE_x86_cpu_id, do_x86cpu_entry},
 	{"cpu", SIZE_cpu_feature, do_cpu_entry},
+	{"mcb", SIZE_mcb_device_id, do_mcb_entry},
 	{"mei", SIZE_mei_cl_device_id, do_mei_entry},
 	{"rapidio", SIZE_rio_device_id, do_rio_entry},
 	{"ulpi", SIZE_ulpi_device_id, do_ulpi_entry},
-- 
2.51.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/1] mcb: Add missing modpost build support
  2025-12-01 16:07 ` [PATCH v2 1/1] mcb: Add missing modpost build support Jose Javier Rodriguez Barbarin
@ 2025-12-01 18:02   ` Andy Shevchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andy Shevchenko @ 2025-12-01 18:02 UTC (permalink / raw)
  To: Jose Javier Rodriguez Barbarin
  Cc: andy, krzk, linus.walleij, nathan, nsc, gregkh, bleung,
	heikki.krogerus, abhishekpandit, masahiroy, legion, hughd,
	linux-kbuild, linux-kernel, Jorge Sanjuan Garcia

On Mon, Dec 01, 2025 at 05:07:20PM +0100, Jose Javier Rodriguez Barbarin wrote:
> mcb bus is not prepared to autoload client drivers with the data defined on
> the drivers' MODULE_DEVICE_TABLE. modpost cannot access to mcb_table_id
> inside MODULE_DEVICE_TABLE so the data declared inside is ignored.
> 
> Add modpost build support for accessing to the mcb_table_id coded on device
> drivers' MODULE_DEVICE_TABLE.

I believe the idea to add Fixes tag here and make sure it goes to v6.19-rcX.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/1] mcb: Add modpost support for processing MODULE_DEVICE_TABLE
  2025-12-01 16:07 [PATCH v2 0/1] mcb: Add modpost support for processing MODULE_DEVICE_TABLE Jose Javier Rodriguez Barbarin
  2025-12-01 16:07 ` [PATCH v2 1/1] mcb: Add missing modpost build support Jose Javier Rodriguez Barbarin
@ 2025-12-01 18:04 ` Andy Shevchenko
  2025-12-01 18:26   ` Jose Javier Rodriguez Barbarin
  1 sibling, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2025-12-01 18:04 UTC (permalink / raw)
  To: Jose Javier Rodriguez Barbarin
  Cc: andy, krzk, linus.walleij, nathan, nsc, gregkh, bleung,
	heikki.krogerus, abhishekpandit, masahiroy, legion, hughd,
	linux-kbuild, linux-kernel

On Mon, Dec 01, 2025 at 05:07:19PM +0100, Jose Javier Rodriguez Barbarin wrote:
> During the process of update of one of the device drivers that are part of
> mcb bus (gpio-menz127.c), Krzysztof from GPIO subsystem asked me
> why I was adding new MODULE_ALIAS when I also added the same new
> information on MODULE_DEVICE_TABLE.
> 
> You can find the messages here:
> 
> https://lore.kernel.org/linux-gpio/80a20b13-7c6a-4483-9741-568424f957ef@kernel.org/
> 
> After a deeper analysis, I came across that the mcb_table_id defined inside
> MODULE_DEVICE_TABLE on all device drivers was being ignored as modpost was
> not processing the mcb MODULE_DEVICE_TABLE entries. For this reason, former
> contributors were using MODULE_ALIAS for enabling mcb to autoload the
> device drivers.
> 
> My proposal with these changes is to complete the mcb bus by adding
> modpost support for processing mcb MODULE_DEVICE_TABLE.
> 
> Once this patch is merged, I will send patches one by one for removing
> MODULE_ALIAS from all device drivers as they are no longer needed
> (as Andy Shevchenko suggested in v1 review).

Not sure if we need a cover letter for a single change, but yes, this
what I think the best approach and code wise it's fine to me:

Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>

(but we still need a Fixes tag I assume).

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/1] mcb: Add modpost support for processing MODULE_DEVICE_TABLE
  2025-12-01 18:04 ` [PATCH v2 0/1] mcb: Add modpost support for processing MODULE_DEVICE_TABLE Andy Shevchenko
@ 2025-12-01 18:26   ` Jose Javier Rodriguez Barbarin
  0 siblings, 0 replies; 5+ messages in thread
From: Jose Javier Rodriguez Barbarin @ 2025-12-01 18:26 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: andy, krzk, linus.walleij, nathan, nsc, gregkh, bleung,
	heikki.krogerus, abhishekpandit, masahiroy, legion, hughd,
	linux-kbuild, linux-kernel

On Mon, Dec 01, 2025 at 08:04:45PM +0200, Andy Shevchenko wrote:
> On Mon, Dec 01, 2025 at 05:07:19PM +0100, Jose Javier Rodriguez Barbarin wrote:
> > During the process of update of one of the device drivers that are part of
> > mcb bus (gpio-menz127.c), Krzysztof from GPIO subsystem asked me
> > why I was adding new MODULE_ALIAS when I also added the same new
> > information on MODULE_DEVICE_TABLE.
> > 
> > You can find the messages here:
> > 
> > https://lore.kernel.org/linux-gpio/80a20b13-7c6a-4483-9741-568424f957ef@kernel.org/
> > 
> > After a deeper analysis, I came across that the mcb_table_id defined inside
> > MODULE_DEVICE_TABLE on all device drivers was being ignored as modpost was
> > not processing the mcb MODULE_DEVICE_TABLE entries. For this reason, former
> > contributors were using MODULE_ALIAS for enabling mcb to autoload the
> > device drivers.
> > 
> > My proposal with these changes is to complete the mcb bus by adding
> > modpost support for processing mcb MODULE_DEVICE_TABLE.
> > 
> > Once this patch is merged, I will send patches one by one for removing
> > MODULE_ALIAS from all device drivers as they are no longer needed
> > (as Andy Shevchenko suggested in v1 review).
> 
> Not sure if we need a cover letter for a single change, but yes, this
> what I think the best approach and code wise it's fine to me:
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> 
> (but we still need a Fixes tag I assume).

Yes, I also though that a cover letter for a single patch could be a bit
useless but I wanted to explain myself the changes from v1 to v2.

I think now I understood why I should include the fixes tag in the
commit message. Let me send v3 with fixes tag and without a cover letter.

Best regards,

Javier R.

> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-12-01 18:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-01 16:07 [PATCH v2 0/1] mcb: Add modpost support for processing MODULE_DEVICE_TABLE Jose Javier Rodriguez Barbarin
2025-12-01 16:07 ` [PATCH v2 1/1] mcb: Add missing modpost build support Jose Javier Rodriguez Barbarin
2025-12-01 18:02   ` Andy Shevchenko
2025-12-01 18:04 ` [PATCH v2 0/1] mcb: Add modpost support for processing MODULE_DEVICE_TABLE Andy Shevchenko
2025-12-01 18:26   ` Jose Javier Rodriguez Barbarin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox