clk: davinci: guard da850-specific init data references
Subsystems (2)
PATCH 1/1 clk: davinci: guard da850-specific init data references
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.
--- drivers/clk/davinci/pll.c | 6 ++++++ drivers/clk/davinci/psc.c | 4 ++++ 2 files changed, 10 insertions(+)
drivers/clk/davinci/pll.c +6 -0
@@ -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 { } };
drivers/clk/davinci/psc.c +4 -0
@@ -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 { } };
Signature · 1 line
2.55.0
[email protected]
AI reviewThank 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…
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 <[email protected]>
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.
drivers/clk/davinci/pll.c int of_davinci_pll_init(struct device *dev, struct device_node *node, · line 844
Quoted 9 lines
drivers/clk/davinci/pll.c +1
-0@@ -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?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Quoted 25 lines · On Tue, Aug 11, 2026 at 12:17 PM <[email protected]> wrote:
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The patch uses a non-existentKconfigmacroCONFIG_COMMON_CLK_DAVINCI_DA850to 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 <[email protected]>clk: davinci: guard da850-specific init data references
This commit attempts to fix undefined reference link errors in
COMPILE_TESTbuilds by wrapping DA850-specific clock data and declarations in a new preprocessor guard.Quoted 8 lines
drivers/clk/davinci/pll.c +0
-0@@ -841,17 +841,23 @@ int of_davinci_pll_init(struct device *dev, struct device_node *node,return 0 ; }
Quoted 4 lines
drivers/clk/davinci/pll.c int of_davinci_pll_init(struct device *dev, struct device_node *node, · line 844
Quoted 1 line
drivers/clk/davinci/pll.c +1
-0+#ifdef CONFIG_COMMON_CLK_DAVINCI_DA850 [Severity: High]
Does theCONFIG_COMMON_CLK_DAVINCI_DA850Kconfigoption actually exist?
yes it does...
Quoted 8 lines
It appears this should be checking
CONFIG_ARCH_DAVINCI_DA850instead. 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 bothpll.candpsc.c) are no longer compiled in?--
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
David Lechner
maintainerQuoted 6 lines · Rosen Penev
With
COMPILE_TESTsupport,COMMON_CLK_DAVINCIcan be enabled on architectures without DaVinci support, whereCOMMON_CLK_DAVINCI_DA850is not set.pll.candpsc.cunconditionally reference da850 init functions and init data that are only built with the DA850 option, resulting in undefined reference link errors.
Quoted 6 lines
Guard the da850 entries in the match tables and the
CLK_OF_DECLAREwithCONFIG_COMMON_CLK_DAVINCI_DA850.Reported-by kernel test robot <[email protected]>Fixes 34aeb6853fe2 ("clk: davinci: add COMPILE_TEST support")
I don't think this patch was ever accepted, so you just need to send a v3 of that patch. Plus I left a comment on v2 that was never addressed.
Quoted 11 lines · David Lechner
Quoted 9 lines · Rosen Penev
With
COMPILE_TESTsupport,COMMON_CLK_DAVINCIcan be enabled on architectures without DaVinci support, whereCOMMON_CLK_DAVINCI_DA850is not set.pll.candpsc.cunconditionally 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_DECLAREwithCONFIG_COMMON_CLK_DAVINCI_DA850.
Quoted 6 lines
Quoted 3 lines
Reported-by kernel test robot <[email protected]>Fixes 34aeb6853fe2 ("clk: davinci: add COMPILE_TEST support")I don't think this patch was ever accepted, so you just need to send a v3 of that patch. Plus I left a comment on v2 that was never addressed.
Hrm I thought the kernel test bot operated on merged commits. Interesting...