public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] module: Fix device table module aliases
@ 2025-10-20 17:53 ` Josh Poimboeuf
  2025-10-20 18:07   ` Cosmin Tanislav
                     ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Josh Poimboeuf @ 2025-10-20 17:53 UTC (permalink / raw)
  To: x86
  Cc: linux-kernel, Petr Mladek, Miroslav Benes, Joe Lawrence,
	live-patching, Song Liu, laokz, Jiri Kosina,
	Marcos Paulo de Souza, Weinan Liu, Fazla Mehrab, Chen Zhongjin,
	Puranjay Mohan, Dylan Hatch, Peter Zijlstra, Alexander Stein,
	Marek Szyprowski, Mark Brown, Cosmin Tanislav

Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
__KBUILD_MODNAME") inadvertently broke module alias generation for
modules which rely on MODULE_DEVICE_TABLE().

It removed the "kmod_" prefix from __KBUILD_MODNAME, which caused
MODULE_DEVICE_TABLE() to generate a symbol name which no longer matched
the format expected by handle_moddevtable() in scripts/mod/file2alias.c.

As a result, modpost failed to find the device tables, leading to
missing module aliases.

Fix this by explicitly adding the "kmod_" string within the
MODULE_DEVICE_TABLE() macro itself, restoring the symbol name to the
format expected by file2alias.c.

Fixes: 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME")
Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reported-by: Mark Brown <broonie@kernel.org>
Reported-by: Cosmin Tanislav <demonsingur@gmail.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 include/linux/module.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index e135cc79aceea..d80c3ea574726 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -251,10 +251,11 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
  */
 #define __mod_device_table(type, name)	\
 	__PASTE(__mod_device_table__,	\
+	__PASTE(kmod_,			\
 	__PASTE(__KBUILD_MODNAME,	\
 	__PASTE(__,			\
 	__PASTE(type,			\
-	__PASTE(__, name)))))
+	__PASTE(__, name))))))
 
 /* Creates an alias so file2alias.c can find device table. */
 #define MODULE_DEVICE_TABLE(type, name)					\
-- 
2.51.0


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

* Re: [PATCH] module: Fix device table module aliases
  2025-10-20 17:53 ` [PATCH] module: Fix device table module aliases Josh Poimboeuf
@ 2025-10-20 18:07   ` Cosmin Tanislav
  2025-10-20 20:40   ` Marek Szyprowski
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Cosmin Tanislav @ 2025-10-20 18:07 UTC (permalink / raw)
  To: Josh Poimboeuf, x86
  Cc: linux-kernel, Petr Mladek, Miroslav Benes, Joe Lawrence,
	live-patching, Song Liu, laokz, Jiri Kosina,
	Marcos Paulo de Souza, Weinan Liu, Fazla Mehrab, Chen Zhongjin,
	Puranjay Mohan, Dylan Hatch, Peter Zijlstra, Alexander Stein,
	Marek Szyprowski, Mark Brown

On 10/20/25 8:53 PM, Josh Poimboeuf wrote:
> Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
> __KBUILD_MODNAME") inadvertently broke module alias generation for
> modules which rely on MODULE_DEVICE_TABLE().
> 
> It removed the "kmod_" prefix from __KBUILD_MODNAME, which caused
> MODULE_DEVICE_TABLE() to generate a symbol name which no longer matched
> the format expected by handle_moddevtable() in scripts/mod/file2alias.c.
> 
> As a result, modpost failed to find the device tables, leading to
> missing module aliases.
> 
> Fix this by explicitly adding the "kmod_" string within the
> MODULE_DEVICE_TABLE() macro itself, restoring the symbol name to the
> format expected by file2alias.c.
> 
> Fixes: 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME")
> Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Reported-by: Mark Brown <broonie@kernel.org>
> Reported-by: Cosmin Tanislav <demonsingur@gmail.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Tested-by: Cosmin Tanislav <demonsingur@gmail.com>

> ---
>   include/linux/module.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/module.h b/include/linux/module.h
> index e135cc79aceea..d80c3ea574726 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -251,10 +251,11 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
>    */
>   #define __mod_device_table(type, name)	\
>   	__PASTE(__mod_device_table__,	\
> +	__PASTE(kmod_,			\
>   	__PASTE(__KBUILD_MODNAME,	\
>   	__PASTE(__,			\
>   	__PASTE(type,			\
> -	__PASTE(__, name)))))
> +	__PASTE(__, name))))))
>   
>   /* Creates an alias so file2alias.c can find device table. */
>   #define MODULE_DEVICE_TABLE(type, name)					\


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

* Re: [PATCH] module: Fix device table module aliases
  2025-10-20 17:53 ` [PATCH] module: Fix device table module aliases Josh Poimboeuf
  2025-10-20 18:07   ` Cosmin Tanislav
@ 2025-10-20 20:40   ` Marek Szyprowski
  2025-10-20 20:55   ` Mark Brown
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Marek Szyprowski @ 2025-10-20 20:40 UTC (permalink / raw)
  To: Josh Poimboeuf, x86
  Cc: linux-kernel, Petr Mladek, Miroslav Benes, Joe Lawrence,
	live-patching, Song Liu, laokz, Jiri Kosina,
	Marcos Paulo de Souza, Weinan Liu, Fazla Mehrab, Chen Zhongjin,
	Puranjay Mohan, Dylan Hatch, Peter Zijlstra, Alexander Stein,
	Mark Brown, Cosmin Tanislav

On 20.10.2025 19:53, Josh Poimboeuf wrote:
> Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
> __KBUILD_MODNAME") inadvertently broke module alias generation for
> modules which rely on MODULE_DEVICE_TABLE().
>
> It removed the "kmod_" prefix from __KBUILD_MODNAME, which caused
> MODULE_DEVICE_TABLE() to generate a symbol name which no longer matched
> the format expected by handle_moddevtable() in scripts/mod/file2alias.c.
>
> As a result, modpost failed to find the device tables, leading to
> missing module aliases.
>
> Fix this by explicitly adding the "kmod_" string within the
> MODULE_DEVICE_TABLE() macro itself, restoring the symbol name to the
> format expected by file2alias.c.
>
> Fixes: 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME")
> Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Reported-by: Mark Brown <broonie@kernel.org>
> Reported-by: Cosmin Tanislav <demonsingur@gmail.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

This fixes the issue observed on my test systems. Thanks!

Closes: 
https://lore.kernel.org/all/d7b49971-8d77-43e2-b0cd-a70c6463ea57@samsung.com/
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>


> ---
>   include/linux/module.h | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/module.h b/include/linux/module.h
> index e135cc79aceea..d80c3ea574726 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -251,10 +251,11 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
>    */
>   #define __mod_device_table(type, name)	\
>   	__PASTE(__mod_device_table__,	\
> +	__PASTE(kmod_,			\
>   	__PASTE(__KBUILD_MODNAME,	\
>   	__PASTE(__,			\
>   	__PASTE(type,			\
> -	__PASTE(__, name)))))
> +	__PASTE(__, name))))))
>   
>   /* Creates an alias so file2alias.c can find device table. */
>   #define MODULE_DEVICE_TABLE(type, name)					\

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


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

* Re: [PATCH] module: Fix device table module aliases
  2025-10-20 17:53 ` [PATCH] module: Fix device table module aliases Josh Poimboeuf
  2025-10-20 18:07   ` Cosmin Tanislav
  2025-10-20 20:40   ` Marek Szyprowski
@ 2025-10-20 20:55   ` Mark Brown
  2025-10-21  6:59   ` Alexander Stein
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2025-10-20 20:55 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, Petr Mladek, Miroslav Benes, Joe Lawrence,
	live-patching, Song Liu, laokz, Jiri Kosina,
	Marcos Paulo de Souza, Weinan Liu, Fazla Mehrab, Chen Zhongjin,
	Puranjay Mohan, Dylan Hatch, Peter Zijlstra, Alexander Stein,
	Marek Szyprowski, Cosmin Tanislav

[-- Attachment #1: Type: text/plain, Size: 617 bytes --]

On Mon, Oct 20, 2025 at 10:53:40AM -0700, Josh Poimboeuf wrote:
> Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
> __KBUILD_MODNAME") inadvertently broke module alias generation for
> modules which rely on MODULE_DEVICE_TABLE().
> 
> It removed the "kmod_" prefix from __KBUILD_MODNAME, which caused
> MODULE_DEVICE_TABLE() to generate a symbol name which no longer matched
> the format expected by handle_moddevtable() in scripts/mod/file2alias.c.

I've not done an exhaustive test of all the impacted platforms but this
looks like it fixes things:

Tested-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] module: Fix device table module aliases
  2025-10-20 17:53 ` [PATCH] module: Fix device table module aliases Josh Poimboeuf
                     ` (2 preceding siblings ...)
  2025-10-20 20:55   ` Mark Brown
@ 2025-10-21  6:59   ` Alexander Stein
  2025-10-22  9:52   ` Chen-Yu Tsai
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Alexander Stein @ 2025-10-21  6:59 UTC (permalink / raw)
  To: x86, Josh Poimboeuf
  Cc: linux-kernel, Petr Mladek, Miroslav Benes, Joe Lawrence,
	live-patching, Song Liu, laokz, Jiri Kosina,
	Marcos Paulo de Souza, Weinan Liu, Fazla Mehrab, Chen Zhongjin,
	Puranjay Mohan, Dylan Hatch, Peter Zijlstra, Marek Szyprowski,
	Mark Brown, Cosmin Tanislav

Am Montag, 20. Oktober 2025, 19:53:40 CEST schrieb Josh Poimboeuf:
> Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
> __KBUILD_MODNAME") inadvertently broke module alias generation for
> modules which rely on MODULE_DEVICE_TABLE().
> 
> It removed the "kmod_" prefix from __KBUILD_MODNAME, which caused
> MODULE_DEVICE_TABLE() to generate a symbol name which no longer matched
> the format expected by handle_moddevtable() in scripts/mod/file2alias.c.
> 
> As a result, modpost failed to find the device tables, leading to
> missing module aliases.
> 
> Fix this by explicitly adding the "kmod_" string within the
> MODULE_DEVICE_TABLE() macro itself, restoring the symbol name to the
> format expected by file2alias.c.
> 
> Fixes: 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME")
> Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Reported-by: Mark Brown <broonie@kernel.org>
> Reported-by: Cosmin Tanislav <demonsingur@gmail.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>

Thanks!

> ---
>  include/linux/module.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/module.h b/include/linux/module.h
> index e135cc79aceea..d80c3ea574726 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -251,10 +251,11 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
>   */
>  #define __mod_device_table(type, name)	\
>  	__PASTE(__mod_device_table__,	\
> +	__PASTE(kmod_,			\
>  	__PASTE(__KBUILD_MODNAME,	\
>  	__PASTE(__,			\
>  	__PASTE(type,			\
> -	__PASTE(__, name)))))
> +	__PASTE(__, name))))))
>  
>  /* Creates an alias so file2alias.c can find device table. */
>  #define MODULE_DEVICE_TABLE(type, name)					\
> 


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/



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

* Re: [PATCH] module: Fix device table module aliases
  2025-10-20 17:53 ` [PATCH] module: Fix device table module aliases Josh Poimboeuf
                     ` (3 preceding siblings ...)
  2025-10-21  6:59   ` Alexander Stein
@ 2025-10-22  9:52   ` Chen-Yu Tsai
  2025-10-22 12:01   ` Mark Brown
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Chen-Yu Tsai @ 2025-10-22  9:52 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, Petr Mladek, Miroslav Benes, Joe Lawrence,
	live-patching, Song Liu, laokz, Jiri Kosina,
	Marcos Paulo de Souza, Weinan Liu, Fazla Mehrab, Chen Zhongjin,
	Puranjay Mohan, Dylan Hatch, Peter Zijlstra, Alexander Stein,
	Marek Szyprowski, Mark Brown, Cosmin Tanislav

On Mon, Oct 20, 2025 at 10:53:40AM -0700, Josh Poimboeuf wrote:
> Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
> __KBUILD_MODNAME") inadvertently broke module alias generation for
> modules which rely on MODULE_DEVICE_TABLE().
> 
> It removed the "kmod_" prefix from __KBUILD_MODNAME, which caused
> MODULE_DEVICE_TABLE() to generate a symbol name which no longer matched
> the format expected by handle_moddevtable() in scripts/mod/file2alias.c.
> 
> As a result, modpost failed to find the device tables, leading to
> missing module aliases.
> 
> Fix this by explicitly adding the "kmod_" string within the
> MODULE_DEVICE_TABLE() macro itself, restoring the symbol name to the
> format expected by file2alias.c.
> 
> Fixes: 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME")
> Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Reported-by: Mark Brown <broonie@kernel.org>
> Reported-by: Cosmin Tanislav <demonsingur@gmail.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>

Tested-by: Chen-Yu Tsai <wenst@chromium.org>

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

* Re: [PATCH] module: Fix device table module aliases
  2025-10-20 17:53 ` [PATCH] module: Fix device table module aliases Josh Poimboeuf
                     ` (4 preceding siblings ...)
  2025-10-22  9:52   ` Chen-Yu Tsai
@ 2025-10-22 12:01   ` Mark Brown
  2025-10-22 13:18     ` Peter Zijlstra
  2025-10-22 13:28   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
  2025-10-22 14:32   ` [PATCH] " Venkat
  7 siblings, 1 reply; 10+ messages in thread
From: Mark Brown @ 2025-10-22 12:01 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, linux-kernel, Petr Mladek, Miroslav Benes, Joe Lawrence,
	live-patching, Song Liu, laokz, Jiri Kosina,
	Marcos Paulo de Souza, Weinan Liu, Fazla Mehrab, Chen Zhongjin,
	Puranjay Mohan, Dylan Hatch, Peter Zijlstra, Alexander Stein,
	Marek Szyprowski, Cosmin Tanislav

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

On Mon, Oct 20, 2025 at 10:53:40AM -0700, Josh Poimboeuf wrote:

> Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
> __KBUILD_MODNAME") inadvertently broke module alias generation for
> modules which rely on MODULE_DEVICE_TABLE().

It'd be really good to get this fix applied, modules not loading is
hugely impacting CI coverage for -next - a lot of systems aren't even
able to get their rootfs due to the drivers for it being built as
modules.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] module: Fix device table module aliases
  2025-10-22 12:01   ` Mark Brown
@ 2025-10-22 13:18     ` Peter Zijlstra
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Zijlstra @ 2025-10-22 13:18 UTC (permalink / raw)
  To: Mark Brown
  Cc: Josh Poimboeuf, x86, linux-kernel, Petr Mladek, Miroslav Benes,
	Joe Lawrence, live-patching, Song Liu, laokz, Jiri Kosina,
	Marcos Paulo de Souza, Weinan Liu, Fazla Mehrab, Chen Zhongjin,
	Puranjay Mohan, Dylan Hatch, Alexander Stein, Marek Szyprowski,
	Cosmin Tanislav

On Wed, Oct 22, 2025 at 01:01:40PM +0100, Mark Brown wrote:
> On Mon, Oct 20, 2025 at 10:53:40AM -0700, Josh Poimboeuf wrote:
> 
> > Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
> > __KBUILD_MODNAME") inadvertently broke module alias generation for
> > modules which rely on MODULE_DEVICE_TABLE().
> 
> It'd be really good to get this fix applied, modules not loading is
> hugely impacting CI coverage for -next - a lot of systems aren't even
> able to get their rootfs due to the drivers for it being built as
> modules.

Oh, this needs to go in tip/objtool/core ? This wasn't immediately
obvious to me.

Let me go queue that then.

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

* [tip: objtool/core] module: Fix device table module aliases
  2025-10-20 17:53 ` [PATCH] module: Fix device table module aliases Josh Poimboeuf
                     ` (5 preceding siblings ...)
  2025-10-22 12:01   ` Mark Brown
@ 2025-10-22 13:28   ` tip-bot2 for Josh Poimboeuf
  2025-10-22 14:32   ` [PATCH] " Venkat
  7 siblings, 0 replies; 10+ messages in thread
From: tip-bot2 for Josh Poimboeuf @ 2025-10-22 13:28 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Alexander Stein, Marek Szyprowski, Mark Brown, Cosmin Tanislav,
	Josh Poimboeuf, Peter Zijlstra (Intel), Chen-Yu Tsai,
	Anders Roxell, x86, linux-kernel

The following commit has been merged into the objtool/core branch of tip:

Commit-ID:     9025688bf6d427e553aca911308cd92e92634f51
Gitweb:        https://git.kernel.org/tip/9025688bf6d427e553aca911308cd92e92634f51
Author:        Josh Poimboeuf <jpoimboe@kernel.org>
AuthorDate:    Mon, 20 Oct 2025 10:53:40 -07:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Wed, 22 Oct 2025 15:21:55 +02:00

module: Fix device table module aliases

Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
__KBUILD_MODNAME") inadvertently broke module alias generation for
modules which rely on MODULE_DEVICE_TABLE().

It removed the "kmod_" prefix from __KBUILD_MODNAME, which caused
MODULE_DEVICE_TABLE() to generate a symbol name which no longer matched
the format expected by handle_moddevtable() in scripts/mod/file2alias.c.

As a result, modpost failed to find the device tables, leading to
missing module aliases.

Fix this by explicitly adding the "kmod_" string within the
MODULE_DEVICE_TABLE() macro itself, restoring the symbol name to the
format expected by file2alias.c.

Fixes: 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME")
Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reported-by: Mark Brown <broonie@kernel.org>
Reported-by: Cosmin Tanislav <demonsingur@gmail.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Cosmin Tanislav <demonsingur@gmail.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Mark Brown <broonie@kernel.org>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org>
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://patch.msgid.link/e52ee3edf32874da645a9e037a7d77c69893a22a.1760982784.git.jpoimboe@kernel.org
---
 include/linux/module.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index e135cc7..d80c3ea 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -251,10 +251,11 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
  */
 #define __mod_device_table(type, name)	\
 	__PASTE(__mod_device_table__,	\
+	__PASTE(kmod_,			\
 	__PASTE(__KBUILD_MODNAME,	\
 	__PASTE(__,			\
 	__PASTE(type,			\
-	__PASTE(__, name)))))
+	__PASTE(__, name))))))
 
 /* Creates an alias so file2alias.c can find device table. */
 #define MODULE_DEVICE_TABLE(type, name)					\

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

* Re: [PATCH] module: Fix device table module aliases
  2025-10-20 17:53 ` [PATCH] module: Fix device table module aliases Josh Poimboeuf
                     ` (6 preceding siblings ...)
  2025-10-22 13:28   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
@ 2025-10-22 14:32   ` Venkat
  7 siblings, 0 replies; 10+ messages in thread
From: Venkat @ 2025-10-22 14:32 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: x86, LKML, Petr Mladek, Miroslav Benes, Joe Lawrence,
	live-patching, Song Liu, laokz, Jiri Kosina,
	Marcos Paulo de Souza, Weinan Liu, Fazla Mehrab, Chen Zhongjin,
	Puranjay Mohan, Dylan Hatch, Peter Zijlstra, Alexander Stein,
	Marek Szyprowski, Mark Brown, Cosmin Tanislav



> On 20 Oct 2025, at 11:23 PM, Josh Poimboeuf <jpoimboe@kernel.org> wrote:
> 
> Commit 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from
> __KBUILD_MODNAME") inadvertently broke module alias generation for
> modules which rely on MODULE_DEVICE_TABLE().
> 
> It removed the "kmod_" prefix from __KBUILD_MODNAME, which caused
> MODULE_DEVICE_TABLE() to generate a symbol name which no longer matched
> the format expected by handle_moddevtable() in scripts/mod/file2alias.c.
> 
> As a result, modpost failed to find the device tables, leading to
> missing module aliases.
> 
> Fix this by explicitly adding the "kmod_" string within the
> MODULE_DEVICE_TABLE() macro itself, restoring the symbol name to the
> format expected by file2alias.c.


IBM CI has also encountered this issue. I have tested this patch and it fixes the same.

Report link: https://lore.kernel.org/all/cdf7c458-b28f-4657-8708-1f820369baa6@linux.ibm.com/

Please add below tags.

Reported-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>

Regards,
Venkat.


> Fixes: 6717e8f91db7 ("kbuild: Remove 'kmod_' prefix from __KBUILD_MODNAME")
> Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Reported-by: Mark Brown <broonie@kernel.org>
> Reported-by: Cosmin Tanislav <demonsingur@gmail.com>
> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
> ---
> include/linux/module.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/module.h b/include/linux/module.h
> index e135cc79aceea..d80c3ea574726 100644
> --- a/include/linux/module.h
> +++ b/include/linux/module.h
> @@ -251,10 +251,11 @@ struct module_kobject *lookup_or_create_module_kobject(const char *name);
>  */
> #define __mod_device_table(type, name) \
> __PASTE(__mod_device_table__, \
> + __PASTE(kmod_, \
> __PASTE(__KBUILD_MODNAME, \
> __PASTE(__, \
> __PASTE(type, \
> - __PASTE(__, name)))))
> + __PASTE(__, name))))))
> 
> /* Creates an alias so file2alias.c can find device table. */
> #define MODULE_DEVICE_TABLE(type, name) \
> -- 
> 2.51.0
> 


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

end of thread, other threads:[~2025-10-22 14:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20251020175415eucas1p18b060df78fab64a52a29ad10ac25869e@eucas1p1.samsung.com>
2025-10-20 17:53 ` [PATCH] module: Fix device table module aliases Josh Poimboeuf
2025-10-20 18:07   ` Cosmin Tanislav
2025-10-20 20:40   ` Marek Szyprowski
2025-10-20 20:55   ` Mark Brown
2025-10-21  6:59   ` Alexander Stein
2025-10-22  9:52   ` Chen-Yu Tsai
2025-10-22 12:01   ` Mark Brown
2025-10-22 13:18     ` Peter Zijlstra
2025-10-22 13:28   ` [tip: objtool/core] " tip-bot2 for Josh Poimboeuf
2025-10-22 14:32   ` [PATCH] " Venkat

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