Skip to contentSkip to conversation

s390/idle: Add missing EXPORT_SYMBOL()

PATCH In review Heiko Carstens 3 participants 4 messages Jun 17 – Jun 18 s390

lore
Share & tools
lore

Heiko Carstens

author maintainer
#0 lore raw

PATCH 1/1 s390/idle: Add missing EXPORT_SYMBOL()

Uwe Kleine-König reported this build breakage caused by a recent commit which provides arch specific kcpustat_field_idle()/kcpustat_field_iowait() functions:

ERROR: modpost: "arch_kcpustat_field_idle" [drivers/leds/trigger/ledtrig-activity.ko] undefined!
ERROR: modpost: "arch_kcpustat_field_iowait" [drivers/leds/trigger/ledtrig-activity.ko] undefined!

Fix this by adding the missing EXPORT_SYMBOL().

Fixes 670e057744e0 ("s390/idle: Provide arch specific kcpustat_field_idle()/kcpustat_field_iowait()")
---
 arch/s390/kernel/idle.c | 3 +++
 1 file changed, 3 insertions(+)
arch/s390/kernel/idle.c +3 -0
index 7f7851c001e0..6da8ee22a1d5 100644
@@ -14,6 +14,7 @@
 #include <linux/init.h>
 #include <linux/cpu.h>
 #include <trace/events/power.h>
+#include <linux/export.h>
 #include <asm/cpu_mf.h>
 #include <asm/cputime.h>
 #include <asm/idle.h>
@@ -83,11 +84,13 @@ u64 arch_kcpustat_field_idle(int cpu)
 {
 	return arch_cpu_idle_time(cpu, CPUTIME_IDLE, !nr_iowait_cpu(cpu));
 }
+EXPORT_SYMBOL(arch_kcpustat_field_idle);
 
 u64 arch_kcpustat_field_iowait(int cpu)
 {
 	return arch_cpu_idle_time(cpu, CPUTIME_IOWAIT, nr_iowait_cpu(cpu));
 }
+EXPORT_SYMBOL(arch_kcpustat_field_iowait);
 
 void account_idle_time_irq(void)
 {
Signature · 1 line
2.53.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] Export License Discrepancy: arch_kcpustat_field_idle and arch_kcpustat_field_iowait are exported…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Export License Discrepancy: arch_kcpustat_field_idle and arch_kcpustat_field_iowait are exported via EXPORT_SYMBOL instead of EXPORT_SYMBOL_GPL. --

commit 53dd63a70164da468386d3191eb1e7e24af1b440
Author: Heiko Carstens <[email protected]>

s390/idle: Add missing EXPORT_SYMBOL()

This commit fixes a build breakage for the ledtrig-activity module by exporting the newly introduced arch_kcpustat_field_idle and arch_kcpustat_field_iowait functions.

Quoted 4 lines
arch/s390/kernel/idle.c +0 -0
index 7f7851c001e0a..6da8ee22a1d53 100644

[ ... ]

arch/s390/kernel/idle.c u64 arch_kcpustat_field_idle(int cpu) · line 87

Quoted 5 lines
arch/s390/kernel/idle.c +1 -0
@@ -83,11 +84,13 @@ u64 arch_kcpustat_field_idle(int cpu)
 {
 	return arch_cpu_idle_time(cpu, CPUTIME_IDLE, !nr_iowait_cpu(cpu));
 }
+EXPORT_SYMBOL(arch_kcpustat_field_idle);

[Severity: Low]
Should this use EXPORT_SYMBOL_GPL() instead? The generic implementations of kcpustat_field_idle() in kernel/sched/cputime.c are exported as GPL-only. Using a standard export here circumvents the GPL symbol restriction imposed by the core scheduler.

arch/s390/kernel/idle.c u64 arch_kcpustat_field_idle(int cpu) · line 93

Quoted 6 lines
arch/s390/kernel/idle.c +1 -0
 u64 arch_kcpustat_field_iowait(int cpu)
 {
 	return arch_cpu_idle_time(cpu, CPUTIME_IOWAIT, nr_iowait_cpu(cpu));
 }
+EXPORT_SYMBOL(arch_kcpustat_field_iowait);

[Severity: Low]
Similarly, does this need to be EXPORT_SYMBOL_GPL() to match the generic kcpustat_field_iowait() counterpart?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Tested-by on v1 1/1
#2 lore raw
In reply to Heiko Carstens
Quoted 8 lines · Heiko Carstens

Uwe Kleine-König reported this build breakage caused by a recent commit which provides arch specific kcpustat_field_idle()/kcpustat_field_iowait() functions:

ERROR: modpost: "arch_kcpustat_field_idle" [drivers/leds/trigger/ledtrig-activity.ko] undefined!
ERROR: modpost: "arch_kcpustat_field_iowait" [drivers/leds/trigger/ledtrig-activity.ko] undefined!

Fix this by adding the missing EXPORT_SYMBOL().

Did you consider EXPORT_SYMBOL_GPL() which AFAIK is prefered over the non-GPL one?

Quoted 13 lines
Fixes 670e057744e0 ("s390/idle: Provide arch specific kcpustat_field_idle()/kcpustat_field_iowait()")
---
 arch/s390/kernel/idle.c | 3 +++
 1 file changed, 3 insertions(+)
arch/s390/kernel/idle.c +0 -0
index 7f7851c001e0..6da8ee22a1d5 100644

arch/s390/kernel/idle.c line 20

Quoted 7 lines
arch/s390/kernel/idle.c +1 -0
@@ -14,6 +14,7 @@
 #include <linux/init.h>
 #include <linux/cpu.h>
 #include <trace/events/power.h>
+#include <linux/export.h>
 #include <asm/cpu_mf.h>
 #include <asm/cputime.h>
 #include <asm/idle.h>

When I fixed up the reported issue in my local tree, I didn't add that include, so it seems to be included already implicitly. But I guess adding that explicitly is a good idea.

Quoted 4 lines
arch/s390/kernel/idle.c +0 -0
@@ -83,11 +84,13 @@ u64 arch_kcpustat_field_idle(int cpu)
 {
 	return arch_cpu_idle_time(cpu, CPUTIME_IDLE, !nr_iowait_cpu(cpu));
 }

arch/s390/kernel/idle.c u64 arch_kcpustat_field_idle(int cpu) · line 96

Quoted 10 lines
arch/s390/kernel/idle.c +2 -0
+EXPORT_SYMBOL(arch_kcpustat_field_idle);
 
 u64 arch_kcpustat_field_iowait(int cpu)
 {
 	return arch_cpu_idle_time(cpu, CPUTIME_IOWAIT, nr_iowait_cpu(cpu));
 }
+EXPORT_SYMBOL(arch_kcpustat_field_iowait);
 
 void account_idle_time_irq(void)
 {

Best regards
Uwe

author maintainer
#3 lore raw
Quoted 5 lines · Uwe Kleine-König
Quoted 4 lines · Heiko Carstens

Uwe Kleine-König reported this build breakage caused by a recent commit which provides arch specific kcpustat_field_idle()/kcpustat_field_iowait() functions:

Quoted 7 lines
Quoted 4 lines

ERROR: modpost: "arch_kcpustat_field_idle" [drivers/leds/trigger/ledtrig-activity.ko] undefined!
ERROR: modpost: "arch_kcpustat_field_iowait" [drivers/leds/trigger/ledtrig-activity.ko] undefined!

Fix this by adding the missing EXPORT_SYMBOL().

Did you consider EXPORT_SYMBOL_GPL() which AFAIK is prefered over the non-GPL one?

My mistake. I really shouldn't write patches in a hurry a few minutes before I shutdown my system (what could go wrong?). Sashiko reported the same. Will also be fixed.

Quoted 1 line

Thanks a lot!