From: Masahiro Yamada yamada.masahiro@socionext.com
mainline inclusion from mainline-v5.2-rc1 commit 4c11edfcf70bea4cb0a3f4992ac6a4852e8bdc31 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I46CWD?from=project-issue CVE: NA
In file included from /builds/linux/include/linux/module.h:19, from /builds/linux/arch/arm/plat-omap/dma.c:28: /builds/linux/arch/arm/plat-omap/dma.c:1452:26: error: expected ',' or ';' before 'DRIVER_NAME' 1452 | MODULE_ALIAS("platform:" DRIVER_NAME); | ^~~~~~~~~~~ /builds/linux/include/linux/moduleparam.h:26:47: note: in definition of macro '__MODULE_INFO' 26 | = __MODULE_INFO_PREFIX __stringify(tag) "=" info | ^~~~ /builds/linux/include/linux/module.h:166:30: note: in expansion of macro 'MODULE_INFO' 166 | #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias) | ^~~~~~~~~~~ /builds/linux/arch/arm/plat-omap/dma.c:1452:1: note: in expansion of macro 'MODULE_ALIAS' 1452 | MODULE_ALIAS("platform:" DRIVER_NAME); | ^~~~~~~~~~~~ make[2]: *** [/builds/linux/scripts/Makefile.build:303: arch/arm/plat-omap/dma.o] Error 1 make[2]: Target '__build' not remade because of errors. make[1]: *** [/builds/linux/Makefile:1070: arch/arm/plat-omap] Error 2 ---------------------------------
These files do not define (USBHS_)DRIVER_NAME. Yet, they can be successfully compiled because they are never built as a module by anyone, i.e, the MODULE_ALIAS() calls are always no-op.
A problem showed up when a patch "moduleparam: Save information about built-in modules in separate file" was applied. With this new feature, MODULE_*() will be populated even if the callers are built-in.
To avoid the build errors, the lines referencing to the undefined macro must be removed.
The complete fix is to remove all MODULE_* and #include <linux/module.h> like many "make ... explicitly non-modular" commits did.
For now, I am touching only the offending lines.
Reported-by: Stephen Rothwell sfr@canb.auug.org.au Signed-off-by: Masahiro Yamada yamada.masahiro@socionext.com Acked-by: Daniel Lezcano daniel.lezcano@linaro.org Acked-by: Tony Lindgren tony@atomide.com Signed-off-by: Hanjun Guo guohanjun@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- arch/arm/plat-omap/dma.c | 1 - drivers/clocksource/timer-ti-dm.c | 1 - drivers/mfd/omap-usb-tll.c | 1 - 3 files changed, 3 deletions(-)
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c index d4012d6c0dcb2..5ca4c5fd627a5 100644 --- a/arch/arm/plat-omap/dma.c +++ b/arch/arm/plat-omap/dma.c @@ -1449,7 +1449,6 @@ static void __exit omap_system_dma_exit(void)
MODULE_DESCRIPTION("OMAP SYSTEM DMA DRIVER"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:" DRIVER_NAME); MODULE_AUTHOR("Texas Instruments Inc");
/* diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c index 23414dddc3bae..c4bb2c7cd8854 100644 --- a/drivers/clocksource/timer-ti-dm.c +++ b/drivers/clocksource/timer-ti-dm.c @@ -999,5 +999,4 @@ module_platform_driver(omap_dm_timer_driver);
MODULE_DESCRIPTION("OMAP Dual-Mode Timer Driver"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("platform:" DRIVER_NAME); MODULE_AUTHOR("Texas Instruments Inc"); diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c index 446713dbee27a..93177d85e7a95 100644 --- a/drivers/mfd/omap-usb-tll.c +++ b/drivers/mfd/omap-usb-tll.c @@ -459,7 +459,6 @@ EXPORT_SYMBOL_GPL(omap_tll_disable);
MODULE_AUTHOR("Keshava Munegowda keshava_mgowda@ti.com"); MODULE_AUTHOR("Roger Quadros rogerq@ti.com"); -MODULE_ALIAS("platform:" USBHS_DRIVER_NAME); MODULE_LICENSE("GPL v2"); MODULE_DESCRIPTION("usb tll driver for TI OMAP EHCI and OHCI controllers");
From: Hanjun Guo guohanjun@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I46CWD?from=project-issue CVE: NA
-----------------------------------------------
Fix the build warning:
/builds/linux/arch/arm/kernel/setup.c:971: warning: "CRASH_ALIGN" redefined 971 | #define CRASH_ALIGN (128 << 20) | In file included from /builds/linux/arch/arm/kernel/setup.c:24: /builds/linux/include/linux/kexec.h:67: note: this is the location of the previous definition 67 | #define CRASH_ALIGN SZ_128M |
Signed-off-by: Hanjun Guo guohanjun@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- arch/arm/kernel/setup.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 95db057ed2fab..91345c6b4b7d4 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c @@ -968,6 +968,7 @@ late_initcall(init_machine_late); * The crash region must be aligned to 128MB to avoid * zImage relocating below the reserved region. */ +#undef CRASH_ALIGN #define CRASH_ALIGN (128 << 20)
static inline unsigned long long get_total_mem(void)
From: Hanjun Guo guohanjun@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I46CWD?from=project-issue CVE: NA
-----------------------------------------------
Build error: /builds/linux/kernel/sched/debug.c: In function 'print_cpu_tidy': /builds/linux/kernel/sched/debug.c:812:21: error: 'sched_debug_lock' undeclared (first use in this function); did you mean 'sched_debug_show'? 812 | spin_lock_irqsave(&sched_debug_lock, flags); | ^~~~~~~~~~~~~~~~ /builds/linux/include/linux/spinlock.h:241:34: note: in definition of macro 'raw_spin_lock_irqsave' 241 | flags = _raw_spin_lock_irqsave(lock); \ | ^~~~ /builds/linux/kernel/sched/debug.c:812:2: note: in expansion of macro 'spin_lock_irqsave' 812 | spin_lock_irqsave(&sched_debug_lock, flags); | ^~~~~~~~~~~~~~~~~ /builds/linux/kernel/sched/debug.c:812:21: note: each undeclared identifier is reported only once for each function it appears in 812 | spin_lock_irqsave(&sched_debug_lock, flags); | ^~~~~~~~~~~~~~~~ /builds/linux/include/linux/spinlock.h:241:34: note: in definition of macro 'raw_spin_lock_irqsave' 241 | flags = _raw_spin_lock_irqsave(lock); \ | ^~~~ /builds/linux/kernel/sched/debug.c:812:2: note: in expansion of macro 'spin_lock_irqsave' 812 | spin_lock_irqsave(&sched_debug_lock, flags); | ^~~~~~~~~~~~~~~~~ make[3]: *** [/builds/linux/scripts/Makefile.build:303: kernel/sched/debug.o] Error 1 make[3]: Target '__build' not remade because of errors.
This is because we backported stable commit "sched/debug: Fix cgroup_path[] serialization", and that commit move the sched_debug_lock into #ifdef CONFIG_CGROUP_SCHED .. #endif, which will raise compile error when we set CONFIG_CGROUP_SCHED to n.
The purpose of sched_debug_lock is to serialize the use of the global cgroup_path[] buffer in print_cpu(). The rests of the printk calls don't need serialization from sched_debug_lock.
Fix it by removing the sched_debug_lock in print_cpu_tidy().
Signed-off-by: Hanjun Guo guohanjun@huawei.com Reviewed-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- kernel/sched/debug.c | 5 ----- 1 file changed, 5 deletions(-)
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 3353a2f936f33..fcf2a07ece055 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -806,15 +806,10 @@ void sysrq_sched_debug_show(void) static void print_cpu_tidy(struct seq_file *m, int cpu) { struct rq *run_queue = cpu_rq(cpu); - unsigned long flags;
SEQ_printf(m, "cpu#%d\n", cpu); - spin_lock_irqsave(&sched_debug_lock, flags); - print_rq(m, run_queue, cpu); - spin_unlock_irqrestore(&sched_debug_lock, flags); SEQ_printf(m, "\n"); - }
void sysrq_sched_debug_tidy(void)