* [PATCH] clk: davinci: guard da850-specific init data references
@ 2026-08-11 19:08 Rosen Penev
2026-08-11 19:17 ` sashiko-bot
0 siblings, 1 reply; 3+ messages in thread
From: Rosen Penev @ 2026-08-11 19:08 UTC (permalink / raw)
To: linux-clk
Cc: David Lechner, Michael Turquette, Stephen Boyd, Brian Masney,
Rosen Penev, open list
With COMPILE_TEST support, COMMON_CLK_DAVINCI can be enabled on
architectures without DaVinci support, where COMMON_CLK_DAVINCI_DA850
is not set. pll.c and psc.c unconditionally reference da850 init
functions and init data that are only built with the DA850 option,
resulting in undefined reference link errors.
Guard the da850 entries in the match tables and the CLK_OF_DECLARE
with CONFIG_COMMON_CLK_DAVINCI_DA850.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202608111912.YS4Vg7Jh-lkp@intel.com/
Fixes: 34aeb6853fe2 ("clk: davinci: add COMPILE_TEST support")
Assisted-by: opencode:deepseek-v4-flash-free
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/clk/davinci/pll.c | 6 ++++++
drivers/clk/davinci/psc.c | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/drivers/clk/davinci/pll.c b/drivers/clk/davinci/pll.c
index f73b0ac5d8a0..af95dc27f840 100644
--- a/drivers/clk/davinci/pll.c
+++ b/drivers/clk/davinci/pll.c
@@ -841,17 +841,23 @@ int of_davinci_pll_init(struct device *dev, struct device_node *node,
return 0;
}
+#ifdef CONFIG_COMMON_CLK_DAVINCI_DA850
/* needed in early boot for clocksource/clockevent */
CLK_OF_DECLARE(da850_pll0, "ti,da850-pll0", of_da850_pll0_init);
+#endif
static const struct of_device_id davinci_pll_of_match[] = {
+#ifdef CONFIG_COMMON_CLK_DAVINCI_DA850
{ .compatible = "ti,da850-pll1", .data = of_da850_pll1_init },
+#endif
{ }
};
static const struct platform_device_id davinci_pll_id_table[] = {
+#ifdef CONFIG_COMMON_CLK_DAVINCI_DA850
{ .name = "da850-pll0", .driver_data = (kernel_ulong_t)da850_pll0_init },
{ .name = "da850-pll1", .driver_data = (kernel_ulong_t)da850_pll1_init },
+#endif
{ }
};
diff --git a/drivers/clk/davinci/psc.c b/drivers/clk/davinci/psc.c
index ff603520d56f..318c389eb96f 100644
--- a/drivers/clk/davinci/psc.c
+++ b/drivers/clk/davinci/psc.c
@@ -499,14 +499,18 @@ int of_davinci_psc_clk_init(struct device *dev,
}
static const struct of_device_id davinci_psc_of_match[] = {
+#ifdef CONFIG_COMMON_CLK_DAVINCI_DA850
{ .compatible = "ti,da850-psc0", .data = &of_da850_psc0_init_data },
{ .compatible = "ti,da850-psc1", .data = &of_da850_psc1_init_data },
+#endif
{ }
};
static const struct platform_device_id davinci_psc_id_table[] = {
+#ifdef CONFIG_COMMON_CLK_DAVINCI_DA850
{ .name = "da850-psc0", .driver_data = (kernel_ulong_t)&da850_psc0_init_data },
{ .name = "da850-psc1", .driver_data = (kernel_ulong_t)&da850_psc1_init_data },
+#endif
{ }
};
--
2.55.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: davinci: guard da850-specific init data references
2026-08-11 19:08 [PATCH] clk: davinci: guard da850-specific init data references Rosen Penev
@ 2026-08-11 19:17 ` sashiko-bot
2026-08-11 19:24 ` Rosen Penev
0 siblings, 1 reply; 3+ messages in thread
From: sashiko-bot @ 2026-08-11 19:17 UTC (permalink / raw)
To: Rosen Penev; +Cc: linux-clk
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The patch uses a non-existent Kconfig macro `CONFIG_COMMON_CLK_DAVINCI_DA850` to guard DA850-specific clock definitions, which will unconditionally disable them.
--
--- Patch [1]: [PATCH] clk: davinci: guard da850-specific init data references ---
commit 8310fd74805280b1ea31726bf5935e313dcdb916
Author: Rosen Penev <rosenp@gmail.com>
clk: davinci: guard da850-specific init data references
This commit attempts to fix undefined reference link errors in COMPILE_TEST
builds by wrapping DA850-specific clock data and declarations in a new
preprocessor guard.
Closes: https://lore.kernel.org/oe-kbuild-all/202608111912.YS4Vg7Jh-lkp@intel.com/
> diff --git a/drivers/clk/davinci/pll.c b/drivers/clk/davinci/pll.c
> index f73b0ac5d8a08..af95dc27f840d 100644
> --- a/drivers/clk/davinci/pll.c
> +++ b/drivers/clk/davinci/pll.c
> @@ -841,17 +841,23 @@ int of_davinci_pll_init(struct device *dev, struct device_node *node,
> return 0;
> }
>
> +#ifdef CONFIG_COMMON_CLK_DAVINCI_DA850
[Severity: High]
Does the CONFIG_COMMON_CLK_DAVINCI_DA850 Kconfig option actually exist?
It appears this should be checking CONFIG_ARCH_DAVINCI_DA850 instead. As
currently written, this guard evaluates to false unconditionally. Will this
cause DA850 devices to fail to boot because their early clocks and match
tables (in both pll.c and psc.c) are no longer compiled in?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260811190821.117485-1-rosenp@gmail.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] clk: davinci: guard da850-specific init data references
2026-08-11 19:17 ` sashiko-bot
@ 2026-08-11 19:24 ` Rosen Penev
0 siblings, 0 replies; 3+ messages in thread
From: Rosen Penev @ 2026-08-11 19:24 UTC (permalink / raw)
To: sashiko-reviews; +Cc: linux-clk
On Tue, Aug 11, 2026 at 12:17 PM <sashiko-bot@kernel.org> wrote:
>
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [High] The patch uses a non-existent Kconfig macro `CONFIG_COMMON_CLK_DAVINCI_DA850` to guard DA850-specific clock definitions, which will unconditionally disable them.
> --
>
> --- Patch [1]: [PATCH] clk: davinci: guard da850-specific init data references ---
> commit 8310fd74805280b1ea31726bf5935e313dcdb916
> Author: Rosen Penev <rosenp@gmail.com>
>
> clk: davinci: guard da850-specific init data references
>
> This commit attempts to fix undefined reference link errors in COMPILE_TEST
> builds by wrapping DA850-specific clock data and declarations in a new
> preprocessor guard.
>
> Closes: https://lore.kernel.org/oe-kbuild-all/202608111912.YS4Vg7Jh-lkp@intel.com/
>
> > diff --git a/drivers/clk/davinci/pll.c b/drivers/clk/davinci/pll.c
> > index f73b0ac5d8a08..af95dc27f840d 100644
> > --- a/drivers/clk/davinci/pll.c
> > +++ b/drivers/clk/davinci/pll.c
> > @@ -841,17 +841,23 @@ int of_davinci_pll_init(struct device *dev, struct device_node *node,
> > return 0;
> > }
> >
> > +#ifdef CONFIG_COMMON_CLK_DAVINCI_DA850
>
> [Severity: High]
> Does the CONFIG_COMMON_CLK_DAVINCI_DA850 Kconfig option actually exist?
yes it does...
>
> It appears this should be checking CONFIG_ARCH_DAVINCI_DA850 instead. As
> currently written, this guard evaluates to false unconditionally. Will this
> cause DA850 devices to fail to boot because their early clocks and match
> tables (in both pll.c and psc.c) are no longer compiled in?
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/20260811190821.117485-1-rosenp@gmail.com?part=1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-08-11 19:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-11 19:08 [PATCH] clk: davinci: guard da850-specific init data references Rosen Penev
2026-08-11 19:17 ` sashiko-bot
2026-08-11 19:24 ` Rosen Penev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.