clk: sprd: fix compile-testing
Subsystems (3)
RFC PATCH 1/1 clk: sprd: fix compile-testing
I got a build failure with CONFIG_ARCH_SPRD=m when the main portion of the clock driver failed to get linked into the kernel:
ERROR: modpost: "sprd_pll_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_comp_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_clk_probe" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_clk_regmap_init" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
This is a combination of two trivial bugs:
- A platform should not be 'tristate', it should be a 'bool' symbol like the other platforms, if only for consistency, and to avoid surprises like this one.
- The clk Makefile does not traverse into the sprd subdirectory if the platform is disabled but the drivers are enabled for compile-testing.
Fixing either of the two would be sufficient to address the link failure, but for correctness, both need to be changed.
--- arch/arm64/Kconfig.platforms | 2 +- drivers/clk/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm64/Kconfig.platforms +1 -1
@@ -248,7 +248,7 @@ config ARCH_TEGRA This enables support for the NVIDIA Tegra SoC family. config ARCH_SPRD - tristate "Spreadtrum SoC platform" + bool "Spreadtrum SoC platform" help Support for Spreadtrum ARM based SoCs
drivers/clk/Makefile +1 -1
@@ -105,7 +105,7 @@ obj-$(CONFIG_CLK_SIFIVE) += sifive/ obj-$(CONFIG_ARCH_SIRF) += sirf/ obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/ obj-$(CONFIG_PLAT_SPEAR) += spear/ -obj-$(CONFIG_ARCH_SPRD) += sprd/ +obj-y += sprd/ obj-$(CONFIG_ARCH_STI) += st/ obj-$(CONFIG_ARCH_STRATIX10) += socfpga/ obj-$(CONFIG_ARCH_SUNXI) += sunxi/
Signature · 7 lines
2.26.0 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Chunyan Zhang
reviewerHi Arnd,
Thanks for finding out this and fixing it, but we have a minor concern for changing ARCH_APRD back to bool.
Quoted 18 lines · Arnd Bergmann
I got a build failure with
CONFIG_ARCH_SPRD=mwhen the main portion of the clock driver failed to get linked into the kernel:ERROR: modpost: "
sprd_pll_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_comp_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_clk_probe" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_clk_regmap_init" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
Quoted 5 lines
This is a combination of two trivial bugs:
- A platform should not be 'tristate', it should be a 'bool' symbol like the other platforms, if only for consistency, and to avoid surprises like this one.
After a discussion, we decided to change ARCH_SPRD to tristate, the idea was that we hope we can simply switch all sprd drivers' configs (whose default is ARCH_SPRD) to 'm' by setting ARCH_SPRD=m, or switch all them to 'y' by setting ARCH_SPRD=y, instead of changing them one by one. This requirement originally came from that Google GKI project asks all vendor drivers to be built as modules.
Thanks,
Chunyan
Quoted 45 lines
- The clk
Makefiledoes not traverse into the sprd subdirectory if the platform is disabled but the drivers are enabled for compile-testing.Fixing either of the two would be sufficient to address the link failure, but for correctness, both need to be changed.
Fixes 2b1b799d7630 ("arm64: change ARCH_SPRD Kconfig to tristate")Fixes d41f59fd92f2 ("clk: sprd: Add common infrastructure")Signed-off-by Arnd Bergmann <[email protected]>--- arch/arm64/Kconfig.platforms | 2 +- drivers/clk/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm64/Kconfig.platforms +1
-1@@ -248,7 +248,7 @@ config ARCH_TEGRA This enables support for the NVIDIA Tegra SoC family. config ARCH_SPRD - tristate "Spreadtrum SoC platform" + bool "Spreadtrum SoC platform" help Support for Spreadtrum ARM based SoCsdrivers/clk/Makefile +1
-2@@ -105,7 +105,7 @@ obj-$(CONFIG_CLK_SIFIVE) += sifive/ obj-$(CONFIG_ARCH_SIRF) += sirf/ obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/ obj-$(CONFIG_PLAT_SPEAR) += spear/ -obj-$(CONFIG_ARCH_SPRD) += sprd/ +obj-y += sprd/ obj-$(CONFIG_ARCH_STI) += st/ obj-$(CONFIG_ARCH_STRATIX10) += socfpga/ obj-$(CONFIG_ARCH_SUNXI) += sunxi/ --2.26.0
A message that is not in the archive (sent off-list or not yet received): CA+nhYX0H-czfJ6Kg+FK7X2=hHQK185UOLGoPdEP3nqWQWcA+bg@mail.gmail.com
Chunyan Zhang
reviewerQuoted 48 lines · Sandeep Patil
Quoted 31 lines · Chunyan Zhang
Hi Arnd,
Thanks for finding out this and fixing it, but we have a minor concern for changing
ARCH_APRDback to bool.Quoted 18 lines · Arnd Bergmann
I got a build failure with
CONFIG_ARCH_SPRD=mwhen the main portion of the clock driver failed to get linked into the kernel:ERROR: modpost: "
sprd_pll_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_comp_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_clk_probe" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_clk_regmap_init" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!Quoted 5 lines
This is a combination of two trivial bugs:
- A platform should not be 'tristate', it should be a 'bool' symbol like the other platforms, if only for consistency, and to avoid surprises like this one.
Quoted 6 lines
After a discussion, we decided to change
ARCH_SPRDto tristate, the idea was that we hope we can simply switch all sprd drivers' configs (whose default isARCH_SPRD) to 'm' by setting ARCH_SPRD=m, or switch all them to 'y' by setting ARCH_SPRD=y, instead of changing them one by one. This requirement originally came from that Google GKI project asks all vendor drivers to be built as modules.Unfortunately, even if
ARCH_SPRDcan be tristate, we found out (like Ard did here) that none of the other platform symbols can be tristate :(.So, we are going to enable all
CONFIG_ARCH_XXXXin our defconfig[1]. Chunyan, Please feel free to submit that patch to AOSP for that.
Quoted 7 lines
This does present us with a problem. We found that a bunch of drivers are 'default y if
ARCH_XXX'. A lot of them have no symbol dependencies on the code that gets compiled withARCH_XXX. They depend on it only because "the driver is only needed for the XXX SoC or the family".For example, enabling
CONFIG_ARCH_MEDIATEK, will end up building almost all drivers indrivers/pinctrl/mediatekas far as I can see.This does add up. It increases the size of the kernel considerably. I have plans to send out the comparison in the future (later this year) once we are done collecting all def configs and see how bad that is.
The only sane way I can see that can be resolved (if people agree that's a problem), is to make the
ARCH_XXXcode tristate-able and make theARCH_XXXKconfigselect every driver it needs, instead of the other way round.
If we making the ARCH_XXX Kconfig select all drivers it needs, we will not have chance to custom the kernel Image for debug purpose. For example we can bringup a minimum system with only serial driver on sprd platforms.
Quoted 2 lines
All that being said, It is obviously not ok to have the allmodconfig broken like this without adding explicit dependencies as suggested above, or revert
CONFIG_ARCH_SPRDto be a 'bool'.
We see this broken because I shouldn't leave clk Makefile a tristate compile [1] after changing ARCH_SPRD to be tristate.
If we will make ARCH_SPRD tristate-able in the future and you all aggree that, I would like to do it now, and pay more attention to Makefiles and dependencies.
I can also make a change like below:
drivers/clk/sprd/Kconfig +1 -0
@@ -2,6 +2,7 @@ config SPRD_COMMON_CLK tristate "Clock support for Spreadtrum SoCs" depends on ARCH_SPRD || COMPILE_TEST + depends on m || ARCH_SPRD != m default ARCH_SPRD select REGMAP_MMIO
Arnd, Stephen, Sandeep, what do you think? Does that make sense?
Thanks,
Chunyan
[1] https://elixir.bootlin.com/linux/v5.6.3/source/drivers/clk/Makefile#L108
Quoted 8 lines
So fwiw,
Acked-by Sandeep Patil <[email protected]>- ssp
Stephen Boyd
maintainerQuoting Chunyan Zhang (2020-04-09 20:45:16)
Quoted 21 lines
We see this broken because I shouldn't leave clk
Makefilea tristate compile [1] after changingARCH_SPRDto be tristate.If we will make
ARCH_SPRDtristate-able in the future and you all aggree that, I would like to do it now, and pay more attention to Makefiles and dependencies.I can also make a change like below:
drivers/clk/sprd/Kconfig +1
-0@@ -2,6 +2,7 @@ config SPRD_COMMON_CLK tristate "Clock support for Spreadtrum SoCs" depends on ARCH_SPRD || COMPILE_TEST + depends on m || ARCH_SPRD != m default ARCH_SPRD select REGMAP_MMIO
Quoted 1 line
Arnd, Stephen, Sandeep, what do you think? Does that make sense?
Sorry, doesn't make any sense to me. The ARCH_FOO configs for various platforms are intended to be used to limit the configuration space of various other Kconfig symbols for the code that only matters to those platforms. The usage of depends and default is correct here already. The ARCH_FOO configs should always be bool. Any code bloat problems seen by config symbols enabling because they're 'default ARCH_FOO' can be resolved by explicitly disabling those configs.
Chunyan Zhang
reviewerQuoted 23 lines · Stephen Boyd
Quoting Chunyan Zhang (2020-04-09 20:45:16)
Quoted 21 lines
We see this broken because I shouldn't leave clk
Makefilea tristate compile [1] after changingARCH_SPRDto be tristate.If we will make
ARCH_SPRDtristate-able in the future and you all aggree that, I would like to do it now, and pay more attention to Makefiles and dependencies.I can also make a change like below:
drivers/clk/sprd/Kconfig +1
-0@@ -2,6 +2,7 @@ config SPRD_COMMON_CLK tristate "Clock support for Spreadtrum SoCs" depends on ARCH_SPRD || COMPILE_TEST + depends on m || ARCH_SPRD != m default ARCH_SPRD select REGMAP_MMIO
Quoted 9 lines
Quoted 1 line
Arnd, Stephen, Sandeep, what do you think? Does that make sense?
Sorry, doesn't make any sense to me. The
ARCH_FOOconfigs for various platforms are intended to be used to limit the configuration space of various otherKconfigsymbols for the code that only matters to those platforms. The usage of depends and default is correct here already. TheARCH_FOOconfigs should always be bool. Any code bloat problems seen by config symbols enabling because they're 'defaultARCH_FOO' can be resolved by explicitly disabling those configs.
Ok - alright, please feel free to merge Arnd's patch then.
Thanks,
Chunyan
Quoting Arnd Bergmann (2020-04-08 09:00:44)
Quoted 30 lines
I got a build failure with
CONFIG_ARCH_SPRD=mwhen the main portion of the clock driver failed to get linked into the kernel:ERROR: modpost: "
sprd_pll_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_comp_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_clk_probe" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_clk_regmap_init" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!This is a combination of two trivial bugs:
- A platform should not be 'tristate', it should be a 'bool' symbol like the other platforms, if only for consistency, and to avoid surprises like this one.
- The clk
Makefiledoes not traverse into the sprd subdirectory if the platform is disabled but the drivers are enabled for compile-testing.Fixing either of the two would be sufficient to address the link failure, but for correctness, both need to be changed.
Quoted 6 lines
Fixes 2b1b799d7630 ("arm64: change ARCH_SPRD Kconfig to tristate")Fixes d41f59fd92f2 ("clk: sprd: Add common infrastructure")Signed-off-by Arnd Bergmann <[email protected]>--- arch/arm64/Kconfig.platforms | 2 +- drivers/clk/Makefile | 2 +-
For clk part
Quoted 28 lines · Arnd Bergmann
I got a build failure with
CONFIG_ARCH_SPRD=mwhen the main portion of the clock driver failed to get linked into the kernel:ERROR: modpost: "
sprd_pll_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_comp_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_sc_gate_ops" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_clk_probe" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_clk_regmap_init" [drivers/clk/sprd/sc9863a-clk.ko] undefined!
ERROR: modpost: "sprd_pll_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
ERROR: modpost: "sprd_div_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!
ERROR: modpost: "sprd_mux_ops" [drivers/clk/sprd/sc9860-clk.ko] undefined!This is a combination of two trivial bugs:
- A platform should not be 'tristate', it should be a 'bool' symbol like the other platforms, if only for consistency, and to avoid surprises like this one.
- The clk
Makefiledoes not traverse into the sprd subdirectory if the platform is disabled but the drivers are enabled for compile-testing.
Quoted 6 lines
Fixing either of the two would be sufficient to address the link failure, but for correctness, both need to be changed.
Fixes 2b1b799d7630 ("arm64: change ARCH_SPRD Kconfig to tristate")Fixes d41f59fd92f2 ("clk: sprd: Add common infrastructure")Signed-off-by Arnd Bergmann <[email protected]>
Hi,
This patch seems not been applied to next branch? I haven't seen it on linux-next.
Arnd, can you please pick it to your tree.
In case you need my ack:
Thanks,
Chunyan
Quoted 34 lines
--- arch/arm64/Kconfig.platforms | 2 +- drivers/clk/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)arch/arm64/Kconfig.platforms +1
-1@@ -248,7 +248,7 @@ config ARCH_TEGRA This enables support for the NVIDIA Tegra SoC family. config ARCH_SPRD - tristate "Spreadtrum SoC platform" + bool "Spreadtrum SoC platform" help Support for Spreadtrum ARM based SoCsdrivers/clk/Makefile +1
-2@@ -105,7 +105,7 @@ obj-$(CONFIG_CLK_SIFIVE) += sifive/ obj-$(CONFIG_ARCH_SIRF) += sirf/ obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/ obj-$(CONFIG_PLAT_SPEAR) += spear/ -obj-$(CONFIG_ARCH_SPRD) += sprd/ +obj-y += sprd/ obj-$(CONFIG_ARCH_STI) += st/ obj-$(CONFIG_ARCH_STRATIX10) += socfpga/ obj-$(CONFIG_ARCH_SUNXI) += sunxi/ --2.26.0
Quoted 9 lines · Chunyan Zhang
On Thu, Apr 9, 2020 at 2:57 AM Arnd Bergmann <[email protected]> wrote:
This patch seems not been applied to next branch? I haven't seen it on linux-next.
Arnd, can you please pick it to your tree.
In case you need my ack:Acked-by Chunyan Zhang <[email protected]>
Ok, I applied it on the arm/drivers branch now, thanks for following up on this!
Arnd