drivers/clocksource/Kconfig | 3 +- drivers/clocksource/exynos_mct.c | 51 ++++++-------------------------- 2 files changed, 10 insertions(+), 44 deletions(-)
Commit 5d86e479193b ("clocksource/drivers/exynos_mct: Add module
support") introduced section mismatch failures.
Commit 7e477e9c4eb4 ("clocksource/drivers/exynos_mct: Fix section
mismatch from the module conversion") replaced these to other section
mismatch failures:
WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x164 (section: .text) -> register_current_timer_delay (section: .init.text)
WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x20c (section: .text) -> register_current_timer_delay (section: .init.text)
ERROR: modpost: Section mismatches detected.
No progress on real fixing of these happened (intermediary fix was still
not tested), so revert both commits till the work is prepared correctly.
Fixes: 7e477e9c4eb4 ("clocksource/drivers/exynos_mct: Fix section mismatch from the module conversion")
Fixes: 5d86e479193b ("clocksource/drivers/exynos_mct: Add module support")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
First build failure:
https://krzk.eu/#/builders/12/builds/3350
---
drivers/clocksource/Kconfig | 3 +-
drivers/clocksource/exynos_mct.c | 51 ++++++--------------------------
2 files changed, 10 insertions(+), 44 deletions(-)
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index d657c8ddc96b..645f517a1ac2 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -451,8 +451,7 @@ config ATMEL_TCB_CLKSRC
Support for Timer Counter Blocks on Atmel SoCs.
config CLKSRC_EXYNOS_MCT
- tristate "Exynos multi core timer driver" if ARM64
- default y if ARCH_EXYNOS || COMPILE_TEST
+ bool "Exynos multi core timer driver" if COMPILE_TEST
depends on ARM || ARM64
depends on ARCH_ARTPEC || ARCH_EXYNOS || COMPILE_TEST
help
diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c
index 80d263ee046d..62febeb4e1de 100644
--- a/drivers/clocksource/exynos_mct.c
+++ b/drivers/clocksource/exynos_mct.c
@@ -15,11 +15,9 @@
#include <linux/cpu.h>
#include <linux/delay.h>
#include <linux/percpu.h>
-#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/of_address.h>
-#include <linux/platform_device.h>
#include <linux/clocksource.h>
#include <linux/sched_clock.h>
@@ -219,7 +217,6 @@ static struct clocksource mct_frc = {
.mask = CLOCKSOURCE_MASK(32),
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
.resume = exynos4_frc_resume,
- .owner = THIS_MODULE,
};
/*
@@ -244,7 +241,7 @@ static cycles_t exynos4_read_current_timer(void)
}
#endif
-static int exynos4_clocksource_init(bool frc_shared)
+static int __init exynos4_clocksource_init(bool frc_shared)
{
/*
* When the frc is shared, the main processor should have already
@@ -339,7 +336,6 @@ static struct clock_event_device mct_comp_device = {
.set_state_oneshot = mct_set_state_shutdown,
.set_state_oneshot_stopped = mct_set_state_shutdown,
.tick_resume = mct_set_state_shutdown,
- .owner = THIS_MODULE,
};
static irqreturn_t exynos4_mct_comp_isr(int irq, void *dev_id)
@@ -480,7 +476,6 @@ static int exynos4_mct_starting_cpu(unsigned int cpu)
evt->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT |
CLOCK_EVT_FEAT_PERCPU;
evt->rating = MCT_CLKEVENTS_RATING;
- evt->owner = THIS_MODULE;
exynos4_mct_write(TICK_BASE_CNT, mevt->base + MCT_L_TCNTB_OFFSET);
@@ -516,7 +511,7 @@ static int exynos4_mct_dying_cpu(unsigned int cpu)
return 0;
}
-static int exynos4_timer_resources(struct device_node *np)
+static int __init exynos4_timer_resources(struct device_node *np)
{
struct clk *mct_clk, *tick_clk;
@@ -544,7 +539,7 @@ static int exynos4_timer_resources(struct device_node *np)
* @local_idx: array mapping CPU numbers to local timer indices
* @nr_local: size of @local_idx array
*/
-static int exynos4_timer_interrupts(struct device_node *np,
+static int __init exynos4_timer_interrupts(struct device_node *np,
unsigned int int_type,
const u32 *local_idx,
size_t nr_local)
@@ -657,7 +652,7 @@ static int exynos4_timer_interrupts(struct device_node *np,
return err;
}
-static __init_or_module int mct_init_dt(struct device_node *np, unsigned int int_type)
+static int __init mct_init_dt(struct device_node *np, unsigned int int_type)
{
bool frc_shared = of_property_read_bool(np, "samsung,frc-shared");
u32 local_idx[MCT_NR_LOCAL] = {0};
@@ -705,43 +700,15 @@ static __init_or_module int mct_init_dt(struct device_node *np, unsigned int int
return exynos4_clockevent_init();
}
-static __init_or_module int mct_init_spi(struct device_node *np)
+
+static int __init mct_init_spi(struct device_node *np)
{
return mct_init_dt(np, MCT_INT_SPI);
}
-static __init_or_module int mct_init_ppi(struct device_node *np)
+static int __init mct_init_ppi(struct device_node *np)
{
return mct_init_dt(np, MCT_INT_PPI);
}
-
-static int exynos4_mct_probe(struct platform_device *pdev)
-{
- struct device *dev = &pdev->dev;
- int (*mct_init)(struct device_node *np);
-
- mct_init = of_device_get_match_data(dev);
- if (!mct_init)
- return -EINVAL;
-
- return mct_init(dev->of_node);
-}
-
-static const struct of_device_id exynos4_mct_match_table[] = {
- { .compatible = "samsung,exynos4210-mct", .data = &mct_init_spi, },
- { .compatible = "samsung,exynos4412-mct", .data = &mct_init_ppi, },
- {}
-};
-MODULE_DEVICE_TABLE(of, exynos4_mct_match_table);
-
-static struct platform_driver exynos4_mct_driver = {
- .probe = exynos4_mct_probe,
- .driver = {
- .name = "exynos-mct",
- .of_match_table = exynos4_mct_match_table,
- },
-};
-module_platform_driver(exynos4_mct_driver);
-
-MODULE_DESCRIPTION("Exynos Multi Core Timer Driver");
-MODULE_LICENSE("GPL");
+TIMER_OF_DECLARE(exynos4210, "samsung,exynos4210-mct", mct_init_spi);
+TIMER_OF_DECLARE(exynos4412, "samsung,exynos4412-mct", mct_init_ppi);
--
2.48.1
On 25/07/2025 11:03, Krzysztof Kozlowski wrote: > Commit 5d86e479193b ("clocksource/drivers/exynos_mct: Add module > support") introduced section mismatch failures. > Commit 7e477e9c4eb4 ("clocksource/drivers/exynos_mct: Fix section > mismatch from the module conversion") replaced these to other section > mismatch failures: > > WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x164 (section: .text) -> register_current_timer_delay (section: .init.text) > WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x20c (section: .text) -> register_current_timer_delay (section: .init.text) > ERROR: modpost: Section mismatches detected. > > No progress on real fixing of these happened (intermediary fix was still > not tested), so revert both commits till the work is prepared correctly. Please don't claim the fix was not tested. I reproduced the section mismatch, tested it and figured out it was indeed fixing the issue. I just missed the error because it sounds very close to the first one reported initially and I did the confusion. The driver is not supposed to be compiled as a module on ARM32. The option tristate "Exynos multi core timer driver" if ARM64 is misleading. From this change, the defconfig on ARM can do CONFIG_EXYNOS_MCT=m which should not be allowed. Before getting wild and revert everything, let's try to find a proper fix for that. Thanks -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
On 25/07/2025 11:28, Daniel Lezcano wrote: > On 25/07/2025 11:03, Krzysztof Kozlowski wrote: >> Commit 5d86e479193b ("clocksource/drivers/exynos_mct: Add module >> support") introduced section mismatch failures. >> Commit 7e477e9c4eb4 ("clocksource/drivers/exynos_mct: Fix section >> mismatch from the module conversion") replaced these to other section >> mismatch failures: >> >> WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x164 (section: .text) -> register_current_timer_delay (section: .init.text) >> WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x20c (section: .text) -> register_current_timer_delay (section: .init.text) >> ERROR: modpost: Section mismatches detected. >> >> No progress on real fixing of these happened (intermediary fix was still >> not tested), so revert both commits till the work is prepared correctly. > > Please don't claim the fix was not tested. I reproduced the section section mismatch code MUST BE tested with enabled DEBUG_SECTION_MISMATCH and disabled SECTION_MISMATCH_WARN_ONLY. If you have warnings which you missed (although if you have warnings what did you fix?), means you did not prepare testing setup. > mismatch, tested it and figured out it was indeed fixing the issue. I > just missed the error because it sounds very close to the first one > reported initially and I did the confusion. > > The driver is not supposed to be compiled as a module on ARM32. > > The option tristate "Exynos multi core timer driver" if ARM64 is > misleading. From this change, the defconfig on ARM can do > CONFIG_EXYNOS_MCT=m which should not be allowed. > > Before getting wild and revert everything, let's try to find a proper > fix for that. I am not wild here. The issue is there since 9 days. Best regards, Krzysztof
On 07/25/2025, Krzysztof Kozlowski wrote: > On 25/07/2025 11:28, Daniel Lezcano wrote: > > On 25/07/2025 11:03, Krzysztof Kozlowski wrote: > >> Commit 5d86e479193b ("clocksource/drivers/exynos_mct: Add module > >> support") introduced section mismatch failures. > >> Commit 7e477e9c4eb4 ("clocksource/drivers/exynos_mct: Fix section > >> mismatch from the module conversion") replaced these to other section > >> mismatch failures: > >> > >> WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x164 (section: .text) -> register_current_timer_delay (section: .init.text) > >> WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x20c (section: .text) -> register_current_timer_delay (section: .init.text) > >> ERROR: modpost: Section mismatches detected. > >> > >> No progress on real fixing of these happened (intermediary fix was still > >> not tested), so revert both commits till the work is prepared correctly. > > > > Please don't claim the fix was not tested. I reproduced the section > > > section mismatch code MUST BE tested with enabled DEBUG_SECTION_MISMATCH > and disabled SECTION_MISMATCH_WARN_ONLY. If you have warnings which you > missed (although if you have warnings what did you fix?), means you did > not prepare testing setup. Thanks Krzysztof for reporting this! Sorry for the mess this has created. I was unaware of testing with DEBUG_SECTION_MISMATCH and clearly missed those warnings when I compile tested with ARCH=arm. I see the issue and will fix the patches accordingly. Regarding ARM32 runtime testing, how do I ensure my patch series is testing on ARM32 devices? The series was discussed on the list for quite some time and I'm wondering what step I missed to get this further tested? Do I just need to explicitly request for ARM32 testing on the list? To avoid this in the future, I took a look at the thread that introduced the section mismatch warning [1] and wondering (before I propose this broadly) if we can make section mismatches fatal by default for everything except allmodconfig? Then we can selectively disable it where appropriate. [1] https://lore.kernel.org/all/1443807963-36364-1-git-send-email-drinkcat@chromium.org/ Thanks, Will > > > mismatch, tested it and figured out it was indeed fixing the issue. I > > just missed the error because it sounds very close to the first one > > reported initially and I did the confusion. > > > > The driver is not supposed to be compiled as a module on ARM32. > > > > The option tristate "Exynos multi core timer driver" if ARM64 is > > misleading. From this change, the defconfig on ARM can do > > CONFIG_EXYNOS_MCT=m which should not be allowed. > > > > Before getting wild and revert everything, let's try to find a proper > > fix for that. > > I am not wild here. The issue is there since 9 days. > > Best regards, > Krzysztof
On 25/07/2025 11:35, Krzysztof Kozlowski wrote: > On 25/07/2025 11:28, Daniel Lezcano wrote: >> On 25/07/2025 11:03, Krzysztof Kozlowski wrote: >>> Commit 5d86e479193b ("clocksource/drivers/exynos_mct: Add module >>> support") introduced section mismatch failures. >>> Commit 7e477e9c4eb4 ("clocksource/drivers/exynos_mct: Fix section >>> mismatch from the module conversion") replaced these to other section >>> mismatch failures: >>> >>> WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x164 (section: .text) -> register_current_timer_delay (section: .init.text) >>> WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x20c (section: .text) -> register_current_timer_delay (section: .init.text) >>> ERROR: modpost: Section mismatches detected. >>> >>> No progress on real fixing of these happened (intermediary fix was still >>> not tested), so revert both commits till the work is prepared correctly. >> >> Please don't claim the fix was not tested. I reproduced the section > > > section mismatch code MUST BE tested with enabled DEBUG_SECTION_MISMATCH > and disabled SECTION_MISMATCH_WARN_ONLY. If you have warnings which you > missed (although if you have warnings what did you fix?), means you did > not prepare testing setup. > >> mismatch, tested it and figured out it was indeed fixing the issue. I >> just missed the error because it sounds very close to the first one >> reported initially and I did the confusion. >> >> The driver is not supposed to be compiled as a module on ARM32. >> >> The option tristate "Exynos multi core timer driver" if ARM64 is >> misleading. From this change, the defconfig on ARM can do >> CONFIG_EXYNOS_MCT=m which should not be allowed. >> >> Before getting wild and revert everything, let's try to find a proper >> fix for that. > > I am not wild here. The issue is there since 9 days. BTW, merge window will start anytime soon, so if you do not apply this revert and do not fix it soon, it means NOTHING during merge window will be tested on Exynos. Why? Because my builds for Exynos rely on correct sections and they fail. Failed builds means: no boots. No boots means no testing. And if this reaches rc1 (imagine you send fixes AFTER rc1), then all my branches will be non-booting as well. Time to "not be wild" was 9 days ago when you received reply from Arnd. Now reverting these is the appropriate step. None of this work was tested on arm32 Exynos, BTW. Best regards, Krzysztof
On 25/07/2025 11:47, Krzysztof Kozlowski wrote: > On 25/07/2025 11:35, Krzysztof Kozlowski wrote: >> On 25/07/2025 11:28, Daniel Lezcano wrote: >>> On 25/07/2025 11:03, Krzysztof Kozlowski wrote: >>>> Commit 5d86e479193b ("clocksource/drivers/exynos_mct: Add module >>>> support") introduced section mismatch failures. >>>> Commit 7e477e9c4eb4 ("clocksource/drivers/exynos_mct: Fix section >>>> mismatch from the module conversion") replaced these to other section >>>> mismatch failures: >>>> >>>> WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x164 (section: .text) -> register_current_timer_delay (section: .init.text) >>>> WARNING: modpost: vmlinux: section mismatch in reference: mct_init_dt+0x20c (section: .text) -> register_current_timer_delay (section: .init.text) >>>> ERROR: modpost: Section mismatches detected. >>>> >>>> No progress on real fixing of these happened (intermediary fix was still >>>> not tested), so revert both commits till the work is prepared correctly. >>> >>> Please don't claim the fix was not tested. I reproduced the section >> >> >> section mismatch code MUST BE tested with enabled DEBUG_SECTION_MISMATCH >> and disabled SECTION_MISMATCH_WARN_ONLY. If you have warnings which you >> missed (although if you have warnings what did you fix?), means you did >> not prepare testing setup. >> >>> mismatch, tested it and figured out it was indeed fixing the issue. I >>> just missed the error because it sounds very close to the first one >>> reported initially and I did the confusion. >>> >>> The driver is not supposed to be compiled as a module on ARM32. >>> >>> The option tristate "Exynos multi core timer driver" if ARM64 is >>> misleading. From this change, the defconfig on ARM can do >>> CONFIG_EXYNOS_MCT=m which should not be allowed. >>> >>> Before getting wild and revert everything, let's try to find a proper >>> fix for that. >> >> I am not wild here. The issue is there since 9 days. > BTW, merge window will start anytime soon, so if you do not apply this > revert and do not fix it soon, it means NOTHING during merge window will > be tested on Exynos. > > Why? > > Because my builds for Exynos rely on correct sections and they fail. > Failed builds means: no boots. > > No boots means no testing. > > And if this reaches rc1 (imagine you send fixes AFTER rc1), then all my > branches will be non-booting as well. > > Time to "not be wild" was 9 days ago when you received reply from Arnd. > Now reverting these is the appropriate step. None of this work was > tested on arm32 Exynos, BTW. Yes, indeed. Fair enough. Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org> -- <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
© 2016 - 2025 Red Hat, Inc.