public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] clocksource: Add module support for timer drivers
@ 2026-01-19  9:55 Zhipeng Wang
  2026-01-19  9:55 ` [PATCH v2 1/4] clocksource/drivers/mmio: Export clocksource_mmio_init() Zhipeng Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Zhipeng Wang @ 2026-01-19  9:55 UTC (permalink / raw)
  To: daniel.lezcano, tglx
  Cc: shawnguo, s.hauer, kernel, festevam, matthias.bgg,
	angelogioacchino.delregno, linux-kernel, imx, linux-arm-kernel,
	linux-mediatek, chun-hung.wu, walter.chang, jstultz, amergnat,
	aisheng.dong, jindong.yue, xuegang.liu

This patch series enables clocksource timer drivers to be built as
loadable kernel modules, which is particularly useful for GKI
(Generic Kernel Image) configurations.

This series is based on the previous MediaTek timer modularization work:
Link: https://lore.kernel.org/all/20230517022557.24388-1-walter.chang@mediatek.com/

The series includes:
1. Export necessary functions from clocksource/mmio
2. Remove __init markings from timer-of to support modules
3. Convert MediaTek timer driver to support module build
4. Convert i.MX TPM timer driver to support module build

Testing performed:
- Built and tested on i.MX8ULP platform
- Built and tested on MediaTek platform
- Verified both built-in and module configurations
- Confirmed timer functionality in both configurations

Changes in v2:
- Added Signed-off-by from submitter (Zhipeng Wang) to all patches
  as requested by reviewers

Changes in v1:
- Fixed 'unsigned' to 'unsigned int' in clocksource_mmio_init()
- Changed MODULE_LICENSE from "GPL v2" to "GPL" for mediatek driver
- Added i.MX TPM timer driver module support

Chun-Hung Wu (3):
  clocksource/drivers/mmio: Export clocksource_mmio_init()
  clocksource/drivers/timer-of: Remove __init markings
  clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module

Jindong Yue (1):
  clocksource/drivers/imx-tpm: Support building imx-tpm driver as module

 drivers/clocksource/Kconfig          |  4 ++--
 drivers/clocksource/mmio.c           |  8 ++++---
 drivers/clocksource/timer-imx-tpm.c  | 36 +++++++++++++++++++++++++---
 drivers/clocksource/timer-mediatek.c | 33 +++++++++++++++++++++++++
 drivers/clocksource/timer-of.c       | 23 +++++++++---------
 drivers/clocksource/timer-of.h       |  6 ++---
 6 files changed, 88 insertions(+), 22 deletions(-)

-- 
2.34.1



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

* [PATCH v2 1/4] clocksource/drivers/mmio: Export clocksource_mmio_init()
  2026-01-19  9:55 [PATCH v2 0/4] clocksource: Add module support for timer drivers Zhipeng Wang
@ 2026-01-19  9:55 ` Zhipeng Wang
  2026-01-19 10:17   ` Daniel Baluta
  2026-01-19  9:55 ` [PATCH v2 2/4] clocksource/drivers/timer-of: Remove __init markings Zhipeng Wang
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Zhipeng Wang @ 2026-01-19  9:55 UTC (permalink / raw)
  To: daniel.lezcano, tglx
  Cc: shawnguo, s.hauer, kernel, festevam, matthias.bgg,
	angelogioacchino.delregno, linux-kernel, imx, linux-arm-kernel,
	linux-mediatek, chun-hung.wu, walter.chang, jstultz, amergnat,
	aisheng.dong, jindong.yue, xuegang.liu

From: Chun-Hung Wu <chun-hung.wu@mediatek.com>

Export clocksource_mmio_init() and clocksource_mmio_readl_up()
to support building clocksource driver as module,
such as timer-mediatek.c.

Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Signed-off-by: Walter Chang <walter.chang@mediatek.com>
Acked-by: John Stultz <jstultz@google.com>
Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
---
 drivers/clocksource/mmio.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/clocksource/mmio.c b/drivers/clocksource/mmio.c
index 9de751531831..95b591c8aa4a 100644
--- a/drivers/clocksource/mmio.c
+++ b/drivers/clocksource/mmio.c
@@ -21,6 +21,7 @@ u64 clocksource_mmio_readl_up(struct clocksource *c)
 {
 	return (u64)readl_relaxed(to_mmio_clksrc(c)->reg);
 }
+EXPORT_SYMBOL_GPL(clocksource_mmio_readl_up);
 
 u64 clocksource_mmio_readl_down(struct clocksource *c)
 {
@@ -46,9 +47,9 @@ u64 clocksource_mmio_readw_down(struct clocksource *c)
  * @bits:	Number of valid bits
  * @read:	One of clocksource_mmio_read*() above
  */
-int __init clocksource_mmio_init(void __iomem *base, const char *name,
-	unsigned long hz, int rating, unsigned bits,
-	u64 (*read)(struct clocksource *))
+int clocksource_mmio_init(void __iomem *base, const char *name,
+			  unsigned long hz, int rating, unsigned int bits,
+			  u64 (*read)(struct clocksource *))
 {
 	struct clocksource_mmio *cs;
 
@@ -68,3 +69,4 @@ int __init clocksource_mmio_init(void __iomem *base, const char *name,
 
 	return clocksource_register_hz(&cs->clksrc, hz);
 }
+EXPORT_SYMBOL_GPL(clocksource_mmio_init);
-- 
2.34.1



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

* [PATCH v2 2/4] clocksource/drivers/timer-of: Remove __init markings
  2026-01-19  9:55 [PATCH v2 0/4] clocksource: Add module support for timer drivers Zhipeng Wang
  2026-01-19  9:55 ` [PATCH v2 1/4] clocksource/drivers/mmio: Export clocksource_mmio_init() Zhipeng Wang
@ 2026-01-19  9:55 ` Zhipeng Wang
  2026-01-19 10:18   ` Daniel Baluta
  2026-01-19  9:55 ` [PATCH v2 3/4] clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module Zhipeng Wang
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Zhipeng Wang @ 2026-01-19  9:55 UTC (permalink / raw)
  To: daniel.lezcano, tglx
  Cc: shawnguo, s.hauer, kernel, festevam, matthias.bgg,
	angelogioacchino.delregno, linux-kernel, imx, linux-arm-kernel,
	linux-mediatek, chun-hung.wu, walter.chang, jstultz, amergnat,
	aisheng.dong, jindong.yue, xuegang.liu

From: Chun-Hung Wu <chun-hung.wu@mediatek.com>

Remove __init markings to allow timer drivers
can be compiled as modules.

Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Signed-off-by: Walter Chang <walter.chang@mediatek.com>
Acked-by: John Stultz <jstultz@google.com>
Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
---
 drivers/clocksource/timer-of.c | 23 ++++++++++++-----------
 drivers/clocksource/timer-of.h |  6 +++---
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c
index 420202bf76e4..b7c186dc83da 100644
--- a/drivers/clocksource/timer-of.c
+++ b/drivers/clocksource/timer-of.c
@@ -19,7 +19,7 @@
  *
  * Free the irq resource
  */
-static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)
+static void timer_of_irq_exit(struct of_timer_irq *of_irq)
 {
 	struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
 
@@ -41,8 +41,8 @@ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)
  *
  * Returns 0 on success, < 0 otherwise
  */
-static __init int timer_of_irq_init(struct device_node *np,
-				    struct of_timer_irq *of_irq)
+static int timer_of_irq_init(struct device_node *np,
+			     struct of_timer_irq *of_irq)
 {
 	int ret;
 	struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
@@ -82,7 +82,7 @@ static __init int timer_of_irq_init(struct device_node *np,
  *
  * Disables and releases the refcount on the clk
  */
-static __init void timer_of_clk_exit(struct of_timer_clk *of_clk)
+static void timer_of_clk_exit(struct of_timer_clk *of_clk)
 {
 	of_clk->rate = 0;
 	clk_disable_unprepare(of_clk->clk);
@@ -98,8 +98,8 @@ static __init void timer_of_clk_exit(struct of_timer_clk *of_clk)
  *
  * Returns 0 on success, < 0 otherwise
  */
-static __init int timer_of_clk_init(struct device_node *np,
-				    struct of_timer_clk *of_clk)
+static int timer_of_clk_init(struct device_node *np,
+			     struct of_timer_clk *of_clk)
 {
 	int ret;
 
@@ -137,13 +137,13 @@ static __init int timer_of_clk_init(struct device_node *np,
 	goto out;
 }
 
-static __init void timer_of_base_exit(struct of_timer_base *of_base)
+static void timer_of_base_exit(struct of_timer_base *of_base)
 {
 	iounmap(of_base->base);
 }
 
-static __init int timer_of_base_init(struct device_node *np,
-				     struct of_timer_base *of_base)
+static int timer_of_base_init(struct device_node *np,
+			      struct of_timer_base *of_base)
 {
 	of_base->base = of_base->name ?
 		of_io_request_and_map(np, of_base->index, of_base->name) :
@@ -156,7 +156,7 @@ static __init int timer_of_base_init(struct device_node *np,
 	return 0;
 }
 
-int __init timer_of_init(struct device_node *np, struct timer_of *to)
+int timer_of_init(struct device_node *np, struct timer_of *to)
 {
 	int ret = -EINVAL;
 	int flags = 0;
@@ -200,6 +200,7 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to)
 		timer_of_base_exit(&to->of_base);
 	return ret;
 }
+EXPORT_SYMBOL_GPL(timer_of_init);
 
 /**
  * timer_of_cleanup - release timer_of resources
@@ -208,7 +209,7 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to)
  * Release the resources that has been used in timer_of_init().
  * This function should be called in init error cases
  */
-void __init timer_of_cleanup(struct timer_of *to)
+void timer_of_cleanup(struct timer_of *to)
 {
 	if (to->flags & TIMER_OF_IRQ)
 		timer_of_irq_exit(&to->of_irq);
diff --git a/drivers/clocksource/timer-of.h b/drivers/clocksource/timer-of.h
index 01a2c6b7db06..367d7023c623 100644
--- a/drivers/clocksource/timer-of.h
+++ b/drivers/clocksource/timer-of.h
@@ -65,9 +65,9 @@ static inline unsigned long timer_of_period(struct timer_of *to)
 	return to->of_clk.period;
 }
 
-extern int __init timer_of_init(struct device_node *np,
-				struct timer_of *to);
+extern int timer_of_init(struct device_node *np,
+			 struct timer_of *to);
 
-extern void __init timer_of_cleanup(struct timer_of *to);
+extern void timer_of_cleanup(struct timer_of *to);
 
 #endif
-- 
2.34.1



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

* [PATCH v2 3/4] clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module
  2026-01-19  9:55 [PATCH v2 0/4] clocksource: Add module support for timer drivers Zhipeng Wang
  2026-01-19  9:55 ` [PATCH v2 1/4] clocksource/drivers/mmio: Export clocksource_mmio_init() Zhipeng Wang
  2026-01-19  9:55 ` [PATCH v2 2/4] clocksource/drivers/timer-of: Remove __init markings Zhipeng Wang
@ 2026-01-19  9:55 ` Zhipeng Wang
  2026-03-03 10:22   ` Markus Elfring
  2026-01-19  9:55 ` [PATCH v2 4/4] clocksource/drivers/imx-tpm: Support building imx-tpm driver as module Zhipeng Wang
  2026-03-03  9:51 ` [PATCH v2 0/4] clocksource: Add module support for timer drivers Zhipeng Wang
  4 siblings, 1 reply; 11+ messages in thread
From: Zhipeng Wang @ 2026-01-19  9:55 UTC (permalink / raw)
  To: daniel.lezcano, tglx
  Cc: shawnguo, s.hauer, kernel, festevam, matthias.bgg,
	angelogioacchino.delregno, linux-kernel, imx, linux-arm-kernel,
	linux-mediatek, chun-hung.wu, walter.chang, jstultz, amergnat,
	aisheng.dong, jindong.yue, xuegang.liu

From: Chun-Hung Wu <chun-hung.wu@mediatek.com>

Make the timer-mediatek driver which can register
an always-on timer as tick_broadcast_device on
MediaTek SoCs become loadable module in GKI.

Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
Signed-off-by: Walter Chang <walter.chang@mediatek.com>
Tested-by: Walter Chang <walter.chang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
---
 drivers/clocksource/Kconfig          |  2 +-
 drivers/clocksource/timer-mediatek.c | 33 ++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index aa59e5b13351..7d0d55c91c3f 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -487,7 +487,7 @@ config SYS_SUPPORTS_SH_CMT
 	bool
 
 config MTK_TIMER
-	bool "Mediatek timer driver" if COMPILE_TEST
+	tristate "MediaTek timer driver"
 	depends on HAS_IOMEM
 	select TIMER_OF
 	select CLKSRC_MMIO
diff --git a/drivers/clocksource/timer-mediatek.c b/drivers/clocksource/timer-mediatek.c
index 7bcb4a3f26fb..4ad4bac6f34b 100644
--- a/drivers/clocksource/timer-mediatek.c
+++ b/drivers/clocksource/timer-mediatek.c
@@ -13,6 +13,9 @@
 #include <linux/clocksource.h>
 #include <linux/interrupt.h>
 #include <linux/irqreturn.h>
+#include <linux/module.h>
+#include <linux/of_device.h>
+#include <linux/platform_device.h>
 #include <linux/sched_clock.h>
 #include <linux/slab.h>
 #include "timer-of.h"
@@ -337,5 +340,35 @@ static int __init mtk_gpt_init(struct device_node *node)
 
 	return 0;
 }
+
+#ifndef MODULE
 TIMER_OF_DECLARE(mtk_mt6577, "mediatek,mt6577-timer", mtk_gpt_init);
 TIMER_OF_DECLARE(mtk_mt6765, "mediatek,mt6765-timer", mtk_syst_init);
+#else
+static int mtk_timer_probe(struct platform_device *pdev)
+{
+	int (*timer_init)(struct device_node *node);
+	struct device_node *np = pdev->dev.of_node;
+
+	timer_init = of_device_get_match_data(&pdev->dev);
+	return timer_init(np);
+}
+
+static const struct of_device_id mtk_timer_match_table[] = {
+	{ .compatible = "mediatek,mt6577-timer", .data = mtk_gpt_init },
+	{ .compatible = "mediatek,mt6765-timer", .data = mtk_syst_init },
+	{ /* sentinel */ }
+};
+
+static struct platform_driver mtk_timer_driver = {
+	.probe = mtk_timer_probe,
+	.driver = {
+		.name = "mediatek-timer",
+		.of_match_table = mtk_timer_match_table,
+	},
+};
+module_platform_driver(mtk_timer_driver);
+
+MODULE_DESCRIPTION("MediaTek Timer driver");
+MODULE_LICENSE("GPL");
+#endif
-- 
2.34.1



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

* [PATCH v2 4/4] clocksource/drivers/imx-tpm: Support building imx-tpm driver as module
  2026-01-19  9:55 [PATCH v2 0/4] clocksource: Add module support for timer drivers Zhipeng Wang
                   ` (2 preceding siblings ...)
  2026-01-19  9:55 ` [PATCH v2 3/4] clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module Zhipeng Wang
@ 2026-01-19  9:55 ` Zhipeng Wang
  2026-01-19 10:38   ` Daniel Baluta
  2026-03-03  9:51 ` [PATCH v2 0/4] clocksource: Add module support for timer drivers Zhipeng Wang
  4 siblings, 1 reply; 11+ messages in thread
From: Zhipeng Wang @ 2026-01-19  9:55 UTC (permalink / raw)
  To: daniel.lezcano, tglx
  Cc: shawnguo, s.hauer, kernel, festevam, matthias.bgg,
	angelogioacchino.delregno, linux-kernel, imx, linux-arm-kernel,
	linux-mediatek, chun-hung.wu, walter.chang, jstultz, amergnat,
	aisheng.dong, jindong.yue, xuegang.liu

From: Jindong Yue <jindong.yue@nxp.com>

Change defconfig as tristate type and add platform driver
to support building it as a module.

Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
---
 drivers/clocksource/Kconfig         |  2 +-
 drivers/clocksource/timer-imx-tpm.c | 36 ++++++++++++++++++++++++++---
 2 files changed, 34 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index 7d0d55c91c3f..511aedf52a32 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -612,7 +612,7 @@ config CLKSRC_IMX_GPT
 	select CLKSRC_MMIO
 
 config CLKSRC_IMX_TPM
-	bool "Clocksource using i.MX TPM" if COMPILE_TEST
+	tristate "Clocksource using i.MX TPM"
 	depends on (ARM || ARM64) && HAVE_CLK
 	select CLKSRC_MMIO
 	select TIMER_OF
diff --git a/drivers/clocksource/timer-imx-tpm.c b/drivers/clocksource/timer-imx-tpm.c
index 92c025b70eb6..419d094459b2 100644
--- a/drivers/clocksource/timer-imx-tpm.c
+++ b/drivers/clocksource/timer-imx-tpm.c
@@ -8,6 +8,8 @@
 #include <linux/clocksource.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
 #include <linux/sched_clock.h>
 
 #include "timer-of.h"
@@ -152,7 +154,7 @@ static struct timer_of to_tpm = {
 	},
 };
 
-static int __init tpm_clocksource_init(void)
+static int tpm_clocksource_init(void)
 {
 #if defined(CONFIG_ARM)
 	tpm_delay_timer.read_current_timer = &tpm_read_current_timer;
@@ -171,7 +173,7 @@ static int __init tpm_clocksource_init(void)
 				     clocksource_mmio_readl_up);
 }
 
-static void __init tpm_clockevent_init(void)
+static void tpm_clockevent_init(void)
 {
 	clockevents_config_and_register(&to_tpm.clkevt,
 					timer_of_rate(&to_tpm) >> 3,
@@ -180,7 +182,7 @@ static void __init tpm_clockevent_init(void)
 					1));
 }
 
-static int __init tpm_timer_init(struct device_node *np)
+static int tpm_timer_init(struct device_node *np)
 {
 	struct clk *ipg;
 	int ret;
@@ -241,4 +243,32 @@ static int __init tpm_timer_init(struct device_node *np)
 
 	return tpm_clocksource_init();
 }
+#ifdef MODULE
+static int tpm_timer_probe(struct platform_device *pdev)
+{
+	struct device_node *np = pdev->dev.of_node;
+
+	return tpm_timer_init(np);
+}
+
+static const struct of_device_id tpm_timer_match_table[] = {
+	{ .compatible = "fsl,imx7ulp-tpm" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, tpm_timer_match_table);
+
+static struct platform_driver tpm_timer_driver = {
+	.probe		= tpm_timer_probe,
+	.driver		= {
+		.name	= "tpm-timer",
+		.of_match_table = tpm_timer_match_table,
+	},
+};
+module_platform_driver(tpm_timer_driver);
+
+#else
 TIMER_OF_DECLARE(imx7ulp, "fsl,imx7ulp-tpm", tpm_timer_init);
+#endif
+
+MODULE_DESCRIPTION("i.MX TPM Timer Driver");
+MODULE_LICENSE("GPL");
-- 
2.34.1



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

* Re: [PATCH v2 1/4] clocksource/drivers/mmio: Export clocksource_mmio_init()
  2026-01-19  9:55 ` [PATCH v2 1/4] clocksource/drivers/mmio: Export clocksource_mmio_init() Zhipeng Wang
@ 2026-01-19 10:17   ` Daniel Baluta
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Baluta @ 2026-01-19 10:17 UTC (permalink / raw)
  To: Zhipeng Wang
  Cc: daniel.lezcano, tglx, shawnguo, s.hauer, kernel, festevam,
	matthias.bgg, angelogioacchino.delregno, linux-kernel, imx,
	linux-arm-kernel, linux-mediatek, chun-hung.wu, walter.chang,
	jstultz, amergnat, aisheng.dong, jindong.yue, xuegang.liu

On Mon, Jan 19, 2026 at 11:59 AM Zhipeng Wang <zhipeng.wang_1@nxp.com> wrote:
>
> From: Chun-Hung Wu <chun-hung.wu@mediatek.com>
>
> Export clocksource_mmio_init() and clocksource_mmio_readl_up()
> to support building clocksource driver as module,
> such as timer-mediatek.c.
>
> Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
> Signed-off-by: Walter Chang <walter.chang@mediatek.com>
> Acked-by: John Stultz <jstultz@google.com>
> Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>


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

* Re: [PATCH v2 2/4] clocksource/drivers/timer-of: Remove __init markings
  2026-01-19  9:55 ` [PATCH v2 2/4] clocksource/drivers/timer-of: Remove __init markings Zhipeng Wang
@ 2026-01-19 10:18   ` Daniel Baluta
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Baluta @ 2026-01-19 10:18 UTC (permalink / raw)
  To: Zhipeng Wang
  Cc: daniel.lezcano, tglx, shawnguo, s.hauer, kernel, festevam,
	matthias.bgg, angelogioacchino.delregno, linux-kernel, imx,
	linux-arm-kernel, linux-mediatek, chun-hung.wu, walter.chang,
	jstultz, amergnat, aisheng.dong, jindong.yue, xuegang.liu

On Mon, Jan 19, 2026 at 12:00 PM Zhipeng Wang <zhipeng.wang_1@nxp.com> wrote:
>
> From: Chun-Hung Wu <chun-hung.wu@mediatek.com>
>
> Remove __init markings to allow timer drivers
> can be compiled as modules.
>
> Signed-off-by: Chun-Hung Wu <chun-hung.wu@mediatek.com>
> Signed-off-by: Walter Chang <walter.chang@mediatek.com>
> Acked-by: John Stultz <jstultz@google.com>
> Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>


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

* Re: [PATCH v2 4/4] clocksource/drivers/imx-tpm: Support building imx-tpm driver as module
  2026-01-19  9:55 ` [PATCH v2 4/4] clocksource/drivers/imx-tpm: Support building imx-tpm driver as module Zhipeng Wang
@ 2026-01-19 10:38   ` Daniel Baluta
  2026-01-20 16:11     ` Daniel Lezcano
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Baluta @ 2026-01-19 10:38 UTC (permalink / raw)
  To: Zhipeng Wang
  Cc: daniel.lezcano, tglx, shawnguo, s.hauer, kernel, festevam,
	matthias.bgg, angelogioacchino.delregno, linux-kernel, imx,
	linux-arm-kernel, linux-mediatek, chun-hung.wu, walter.chang,
	jstultz, amergnat, aisheng.dong, jindong.yue, xuegang.liu

On Mon, Jan 19, 2026 at 11:56 AM Zhipeng Wang <zhipeng.wang_1@nxp.com> wrote:
>
> From: Jindong Yue <jindong.yue@nxp.com>
>
> Change defconfig as tristate type and add platform driver
> to support building it as a module.
>
> Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
> Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>

Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>

So you can now select the driver Y/M/n even if no COMPILE_TEST present.

I wonder why we needed the `if COMPILE_TEST` in the first place. But anyhow,
this change looks good.


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

* Re: [PATCH v2 4/4] clocksource/drivers/imx-tpm: Support building imx-tpm driver as module
  2026-01-19 10:38   ` Daniel Baluta
@ 2026-01-20 16:11     ` Daniel Lezcano
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Lezcano @ 2026-01-20 16:11 UTC (permalink / raw)
  To: Daniel Baluta, Zhipeng Wang
  Cc: tglx, shawnguo, s.hauer, kernel, festevam, matthias.bgg,
	angelogioacchino.delregno, linux-kernel, imx, linux-arm-kernel,
	linux-mediatek, chun-hung.wu, walter.chang, jstultz, amergnat,
	aisheng.dong, jindong.yue, xuegang.liu

On 1/19/26 11:38, Daniel Baluta wrote:
> On Mon, Jan 19, 2026 at 11:56 AM Zhipeng Wang <zhipeng.wang_1@nxp.com> wrote:
>>
>> From: Jindong Yue <jindong.yue@nxp.com>
>>
>> Change defconfig as tristate type and add platform driver
>> to support building it as a module.
>>
>> Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
>> Signed-off-by: Zhipeng Wang <zhipeng.wang_1@nxp.com>
> 
> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
> 
> So you can now select the driver Y/M/n even if no COMPILE_TEST present.
> 
> I wonder why we needed the `if COMPILE_TEST` in the first place. But anyhow,
> this change looks good.

The logic is to keep the timer option silent and let the platform's 
Kconfig to select the timer driver when enabling the platform.

Then we wanted to be able to compile-test those drivers even if the 
platform is not selected.

Now we want to choose between module or compiled-in.

I'm not sure if we really want to manually select the timer driver or 
switch to module.


-- 
<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


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

* RE: [PATCH v2 0/4] clocksource: Add module support for timer drivers
  2026-01-19  9:55 [PATCH v2 0/4] clocksource: Add module support for timer drivers Zhipeng Wang
                   ` (3 preceding siblings ...)
  2026-01-19  9:55 ` [PATCH v2 4/4] clocksource/drivers/imx-tpm: Support building imx-tpm driver as module Zhipeng Wang
@ 2026-03-03  9:51 ` Zhipeng Wang
  4 siblings, 0 replies; 11+ messages in thread
From: Zhipeng Wang @ 2026-03-03  9:51 UTC (permalink / raw)
  To: daniel.lezcano@linaro.org, tglx@kernel.org
  Cc: shawnguo@kernel.org, s.hauer@pengutronix.de,
	kernel@pengutronix.de, festevam@gmail.com, matthias.bgg@gmail.com,
	angelogioacchino.delregno@collabora.com,
	linux-kernel@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, chun-hung.wu@mediatek.com,
	walter.chang@mediatek.com, jstultz@google.com,
	amergnat@baylibre.com, Aisheng Dong, Jindong Yue, Xuegang Liu

Hi Daniel,

Gentle ping on this series:

  [PATCH v2 0/4] clocksource: Add module support for timer drivers

Please take another look when you have time.

Thanks,
Zhipeng

> -----Original Message-----
> From: Zhipeng Wang
> Sent: 2026年1月19日 17:56
> To: daniel.lezcano@linaro.org; tglx@kernel.org
> Cc: shawnguo@kernel.org; s.hauer@pengutronix.de; kernel@pengutronix.de;
> festevam@gmail.com; matthias.bgg@gmail.com;
> angelogioacchino.delregno@collabora.com; linux-kernel@vger.kernel.org;
> imx@lists.linux.dev; linux-arm-kernel@lists.infradead.org;
> linux-mediatek@lists.infradead.org; chun-hung.wu@mediatek.com;
> walter.chang@mediatek.com; jstultz@google.com; amergnat@baylibre.com;
> Aisheng Dong <aisheng.dong@nxp.com>; Jindong Yue
> <jindong.yue@nxp.com>; Xuegang Liu <xuegang.liu@nxp.com>
> Subject: [PATCH v2 0/4] clocksource: Add module support for timer drivers
> 
> This patch series enables clocksource timer drivers to be built as loadable
> kernel modules, which is particularly useful for GKI (Generic Kernel Image)
> configurations.
> 
> This series is based on the previous MediaTek timer modularization work:
> Link:
> https://lore.kernel.org/all/20230517022557.24388-1-walter.chang@mediatek
> .com/
> 
> The series includes:
> 1. Export necessary functions from clocksource/mmio 2. Remove __init
> markings from timer-of to support modules 3. Convert MediaTek timer driver
> to support module build 4. Convert i.MX TPM timer driver to support module
> build
> 
> Testing performed:
> - Built and tested on i.MX8ULP platform
> - Built and tested on MediaTek platform
> - Verified both built-in and module configurations
> - Confirmed timer functionality in both configurations
> 
> Changes in v2:
> - Added Signed-off-by from submitter (Zhipeng Wang) to all patches
>   as requested by reviewers
> 
> Changes in v1:
> - Fixed 'unsigned' to 'unsigned int' in clocksource_mmio_init()
> - Changed MODULE_LICENSE from "GPL v2" to "GPL" for mediatek driver
> - Added i.MX TPM timer driver module support
> 
> Chun-Hung Wu (3):
>   clocksource/drivers/mmio: Export clocksource_mmio_init()
>   clocksource/drivers/timer-of: Remove __init markings
>   clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable
> module
> 
> Jindong Yue (1):
>   clocksource/drivers/imx-tpm: Support building imx-tpm driver as module
> 
>  drivers/clocksource/Kconfig          |  4 ++--
>  drivers/clocksource/mmio.c           |  8 ++++---
>  drivers/clocksource/timer-imx-tpm.c  | 36
> +++++++++++++++++++++++++---  drivers/clocksource/timer-mediatek.c | 33
> +++++++++++++++++++++++++
>  drivers/clocksource/timer-of.c       | 23 +++++++++---------
>  drivers/clocksource/timer-of.h       |  6 ++---
>  6 files changed, 88 insertions(+), 22 deletions(-)
> 
> --
> 2.34.1


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

* Re: [PATCH v2 3/4] clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module
  2026-01-19  9:55 ` [PATCH v2 3/4] clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module Zhipeng Wang
@ 2026-03-03 10:22   ` Markus Elfring
  0 siblings, 0 replies; 11+ messages in thread
From: Markus Elfring @ 2026-03-03 10:22 UTC (permalink / raw)
  To: Chun-Hung Wu, Walter Chang, Zhipeng Wang, linux-mediatek, imx,
	linux-arm-kernel, kernel
  Cc: LKML, Alexandre Mergnat, Angelo Gioacchino Del Regno,
	Daniel Lezcano, Dong Aisheng, Fabio Estevam, Jindong Yue,
	John Stultz, Matthias Brugger, Richard Liu, Sascha Hauer,
	Shawn Guo, Thomas Gleixner

> Make the timer-mediatek driver which can register
> an always-on timer as tick_broadcast_device on
> MediaTek SoCs become loadable module in GKI.

* You may occasionally put more than 49 characters into text lines
  of such a change description.
  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.0-rc2#n659

* Would a summary phrase like “Convert timer-mediatek to a loadable module”
  be more appropriate?


Regards,
Markus


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

end of thread, other threads:[~2026-03-03 10:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-19  9:55 [PATCH v2 0/4] clocksource: Add module support for timer drivers Zhipeng Wang
2026-01-19  9:55 ` [PATCH v2 1/4] clocksource/drivers/mmio: Export clocksource_mmio_init() Zhipeng Wang
2026-01-19 10:17   ` Daniel Baluta
2026-01-19  9:55 ` [PATCH v2 2/4] clocksource/drivers/timer-of: Remove __init markings Zhipeng Wang
2026-01-19 10:18   ` Daniel Baluta
2026-01-19  9:55 ` [PATCH v2 3/4] clocksource/drivers/timer-mediatek: Make timer-mediatek become loadable module Zhipeng Wang
2026-03-03 10:22   ` Markus Elfring
2026-01-19  9:55 ` [PATCH v2 4/4] clocksource/drivers/imx-tpm: Support building imx-tpm driver as module Zhipeng Wang
2026-01-19 10:38   ` Daniel Baluta
2026-01-20 16:11     ` Daniel Lezcano
2026-03-03  9:51 ` [PATCH v2 0/4] clocksource: Add module support for timer drivers Zhipeng Wang

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