Skip to contentSkip to conversation

printk: Export match_devname_and_update_preferred_console()

PATCH Applied Yu Liao 4 participants 7 messages Sep 9, 2024 – Sep 10, 2024 Printk

lore
Share & tools
lore

Yu Liao

author
#0 lore raw

PATCH 1/1 printk: Export match_devname_and_update_preferred_console()

When building serial_base as a module, modpost fails with the following error message:

ERROR: modpost: "match_devname_and_update_preferred_console" [drivers/tty/serial/serial_base.ko] undefined!

Export the symbol to allow using it from modules.

Fixes 12c91cec3155 ("serial: core: Add serial_base_match_and_update_preferred_console()")
---
 kernel/printk/printk.c | 1 +
 1 file changed, 1 insertion(+)
kernel/printk/printk.c +1 -0
index c22b07049c38..6ff8d47e145f 100644
@@ -2620,6 +2620,7 @@ int match_devname_and_update_preferred_console(const char *devname,
 
 	return -ENOENT;
 }
+EXPORT_SYMBOL_GPL(match_devname_and_update_preferred_console);
 
 bool console_suspend_enabled = true;
 EXPORT_SYMBOL(console_suspend_enabled);
Signature · 1 line
2.33.0
#1 lore raw
Quoted 7 lines · Yu Liao

When building serial_base as a module, modpost fails with the following error message:

ERROR: modpost: "match_devname_and_update_preferred_console" [drivers/tty/serial/serial_base.ko] undefined!

Export the symbol to allow using it from modules.

I think the issue is with CONFIG_PRINTK is no set, and serial drivers select SERIAL_CORE_CONSOLE? And when serial_base is a module, there is no kernel console.

I replied earlier today to the lkp error report along those lines, but please let me know if there is more to the issue than that.

Regards,

Tony

Quoted 23 lines
Fixes 12c91cec3155 ("serial: core: Add serial_base_match_and_update_preferred_console()")
---
 kernel/printk/printk.c | 1 +
 1 file changed, 1 insertion(+)
kernel/printk/printk.c +1 -0
index c22b07049c38..6ff8d47e145f 100644
@@ -2620,6 +2620,7 @@ int match_devname_and_update_preferred_console(const char *devname,
 
 	return -ENOENT;
 }
+EXPORT_SYMBOL_GPL(match_devname_and_update_preferred_console);
 
 bool console_suspend_enabled = true;
 EXPORT_SYMBOL(console_suspend_enabled);
Signature · 1 line
2.33.0
#2 lore raw
Quoted 7 lines · Tony Lindgren
Quoted 6 lines · Yu Liao

When building serial_base as a module, modpost fails with the following error message:

ERROR: modpost: "match_devname_and_update_preferred_console" [drivers/tty/serial/serial_base.ko] undefined!

Quoted 8 lines
Quoted 1 line

Export the symbol to allow using it from modules.

I think the issue is with CONFIG_PRINTK is no set, and serial drivers select SERIAL_CORE_CONSOLE? And when serial_base is a module, there is no kernel console.

I replied earlier today to the lkp error report along those lines, but please let me know if there is more to the issue than that.

Sorry I gave wrong information above. The issue can be hit also with CONFIG_PRINTK=y and serial_base as a loadable module.

Regards,

Tony

Quoted 23 lines
Quoted 23 lines
Fixes 12c91cec3155 ("serial: core: Add serial_base_match_and_update_preferred_console()")
---
 kernel/printk/printk.c | 1 +
 1 file changed, 1 insertion(+)
kernel/printk/printk.c +1 -0
index c22b07049c38..6ff8d47e145f 100644
@@ -2620,6 +2620,7 @@ int match_devname_and_update_preferred_console(const char *devname,
 
 	return -ENOENT;
 }
+EXPORT_SYMBOL_GPL(match_devname_and_update_preferred_console);
 
 bool console_suspend_enabled = true;
 EXPORT_SYMBOL(console_suspend_enabled);
Signature · 1 line
2.33.0
maintainer
#3 lore raw
Quoted 14 lines · Tony Lindgren
Quoted 13 lines · Tony Lindgren
Quoted 7 lines · Yu Liao

When building serial_base as a module, modpost fails with the following error message:

ERROR: modpost: "match_devname_and_update_preferred_console" [drivers/tty/serial/serial_base.ko] undefined!

Export the symbol to allow using it from modules.

I think the issue is with CONFIG_PRINTK is no set, and serial drivers select SERIAL_CORE_CONSOLE? And when serial_base is a module, there is no kernel console.

Quoted 5 lines
Quoted 2 lines

I replied earlier today to the lkp error report along those lines, but please let me know if there is more to the issue than that.

Sorry I gave wrong information above. The issue can be hit also with CONFIG_PRINTK=y and serial_base as a loadable module.

Yes, this is my understanding. The problem has happened when serial_base was built as a module. So exporting the symbol looks like the right fix.

Best Regards,
Petr

#4 lore raw
Quoted 15 lines · Petr Mladek
Quoted 14 lines · Tony Lindgren
Quoted 13 lines · Tony Lindgren
Quoted 7 lines · Yu Liao

When building serial_base as a module, modpost fails with the following error message:

ERROR: modpost: "match_devname_and_update_preferred_console" [drivers/tty/serial/serial_base.ko] undefined!

Export the symbol to allow using it from modules.

I think the issue is with CONFIG_PRINTK is no set, and serial drivers select SERIAL_CORE_CONSOLE? And when serial_base is a module, there is no kernel console.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I replied earlier today to the lkp error report along those lines, but please let me know if there is more to the issue than that.

Sorry I gave wrong information above. The issue can be hit also with CONFIG_PRINTK=y and serial_base as a loadable module.

Yes, this is my understanding. The problem has happened when serial_base was built as a module. So exporting the symbol looks like the right fix.

Yes agreed.

And, Yu, thanks for fixing the issue!

Regards,

Tony

maintainer
#5 lore raw
In reply to Yu Liao
Quoted 6 lines · Yu Liao

When building serial_base as a module, modpost fails with the following error message:

ERROR: modpost: "match_devname_and_update_preferred_console" [drivers/tty/serial/serial_base.ko] undefined!

Quoted 6 lines

Export the symbol to allow using it from modules.

Fixes 12c91cec3155 ("serial: core: Add serial_base_match_and_update_preferred_console()")

It looks good. I have pushed the fix into printk/linux.git, branch for-6.11-fixup. I am going to send a pull request later this week.

Best Regards,
Petr

merge bot Applied
#6 lore raw
In reply to Yu Liao
The following commit has been merged into the sched/rt branch of tip:

The following commit has been merged into the sched/rt branch of tip:

Commit-ID:     3e5b2e81f17f176a4d451c1dd1794e64644319c4
Gitweb:        https://git.kernel.org/tip/3e5b2e81f17f176a4d451c1dd1794e64644319c4
Author:        Yu Liao <[email protected]>
AuthorDate:    Mon, 09 Sep 2024 15:56:52 +08:00
Committer:     Petr Mladek <[email protected]>
CommitterDate: Mon, 09 Sep 2024 17:35:06 +02:00

printk: Export match_devname_and_update_preferred_console()

When building serial_base as a module, modpost fails with the following error message:

ERROR: modpost: "match_devname_and_update_preferred_console" [drivers/tty/serial/serial_base.ko] undefined!

Export the symbol to allow using it from modules.

---
 kernel/printk/printk.c | 1 +
 1 file changed, 1 insertion(+)
kernel/printk/printk.c +1 -0
index c22b070..6ff8d47 100644
@@ -2620,6 +2620,7 @@ int match_devname_and_update_preferred_console(const char *devname,
 
 	return -ENOENT;
 }
+EXPORT_SYMBOL_GPL(match_devname_and_update_preferred_console);
 
 bool console_suspend_enabled = true;
 EXPORT_SYMBOL(console_suspend_enabled);