Skip to contentSkip to conversation

Cleanup arm64 driver dependencies

PATCH In review Amit Kucheria 5 participants 19 messages Sep 11, 2019 – Sep 20, 2019

Subsystems (9)
PCI GPIO Common clk arm64 +5 more subsystems
lore
Share & tools
lore
#0 lore raw

cover Cleanup arm64 driver dependencies

I was using initcall_debugging on a QCOM platform and ran across a bunch of driver initcalls that are enabled even if their SoC support is disabled.

Here are some fixups for a subset of them.

Amit Kucheria (4):
arm64: Kconfig: Fix XGENE driver dependencies
arm64: Kconfig: Fix BRCMSTB driver dependencies
arm64: Kconfig: Fix VEXPRESS driver dependencies
arm64: Kconfig: Fix EXYNOS driver dependencies

 arch/arm64/Kconfig.platforms   | 3 +++
 drivers/bus/Kconfig            | 3 ++-
 drivers/clk/Kconfig            | 3 ++-
 drivers/clk/versatile/Kconfig  | 4 ++--
 drivers/gpio/Kconfig           | 1 +
 drivers/pci/controller/Kconfig | 1 +
 drivers/phy/Kconfig            | 1 +
 drivers/power/reset/Kconfig    | 3 ++-
 drivers/regulator/Kconfig      | 1 +
 drivers/soc/bcm/Kconfig        | 1 +
 10 files changed, 16 insertions(+), 5 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/4 arm64: Kconfig: Fix XGENE driver dependencies

Push various XGENE drivers behind ARCH_XGENE dependency so that it doesn't get enabled by default on other platforms.

---
 arch/arm64/Kconfig.platforms   | 3 +++
 drivers/clk/Kconfig            | 2 +-
 drivers/gpio/Kconfig           | 1 +
 drivers/pci/controller/Kconfig | 1 +
 drivers/phy/Kconfig            | 1 +
 drivers/power/reset/Kconfig    | 2 +-
 6 files changed, 8 insertions(+), 2 deletions(-)
arch/arm64/Kconfig.platforms +3 -0
index 4778c775de1b..cdf4e452e34c 100644
@@ -281,6 +281,9 @@ config ARCH_VULCAN
 
 config ARCH_XGENE
 	bool "AppliedMicro X-Gene SOC Family"
+	select COMMON_CLK_XGENE
+	select PCI_XGENE
+	select GPIO_XGENE
 	help
 	  This enables support for AppliedMicro X-Gene SOC Family
 
drivers/clk/Kconfig +1 -1
index 801fa1cd0321..9b2790d3f18a 100644
@@ -225,7 +225,7 @@ config CLK_QORIQ
 
 config COMMON_CLK_XGENE
 	bool "Clock driver for APM XGene SoC"
-	default ARCH_XGENE
+	depends on ARCH_XGENE
 	depends on ARM64 || COMPILE_TEST
 	---help---
 	  Sypport for the APM X-Gene SoC reference, PLL, and device clocks.
drivers/gpio/Kconfig +1 -0
index bb13c266c329..072c749c5c1f 100644
@@ -580,6 +580,7 @@ config GPIO_VX855
 
 config GPIO_XGENE
 	bool "APM X-Gene GPIO controller support"
+	depends on ARCH_XGENE
 	depends on ARM64 && OF_GPIO
 	help
 	  This driver is to support the GPIO block within the APM X-Gene SoC
drivers/pci/controller/Kconfig +1 -0
index fe9f9f13ce11..44699f45784f 100644
@@ -112,6 +112,7 @@ config PCIE_XILINX
 config PCI_XGENE
 	bool "X-Gene PCIe controller"
 	depends on ARM64 || COMPILE_TEST
+	depends on ARCH_XGENE
 	depends on OF || (ACPI && PCI_QUIRKS)
 	help
 	  Say Y here if you want internal PCI support on APM X-Gene SoC.
drivers/phy/Kconfig +1 -0
index 0263db2ac874..7c5eefecdabd 100644
@@ -44,6 +44,7 @@ config PHY_PISTACHIO_USB
 
 config PHY_XGENE
 	tristate "APM X-Gene 15Gbps PHY support"
+	depends on ARCH_XGENE
 	depends on HAS_IOMEM && OF && (ARM64 || COMPILE_TEST)
 	select GENERIC_PHY
 	help
drivers/power/reset/Kconfig +1 -1
index a564237278ff..651b763f80cd 100644
@@ -181,7 +181,7 @@ config POWER_RESET_VEXPRESS
 
 config POWER_RESET_XGENE
 	bool "APM SoC X-Gene reset driver"
-	depends on ARM64
+	depends on ARCH_XGENE && ARM64
 	help
 	  Reboot support for the APM SoC X-Gene Eval boards.
 
Signature · 1 line
2.17.1
#4 lore raw

PATCH 2/4 arm64: Kconfig: Fix BRCMSTB driver dependencies

In reply to Amit Kucheria

Push various BRCMSTB drivers behind ARCH_BRCMSTB dependency so that it doesn't get enabled by default on other platforms.

---
 drivers/bus/Kconfig         | 1 +
 drivers/power/reset/Kconfig | 1 +
 drivers/soc/bcm/Kconfig     | 1 +
 3 files changed, 3 insertions(+)
drivers/bus/Kconfig +1 -0
index 1851112ccc29..d80e8d70bf10 100644
@@ -22,6 +22,7 @@ config ARM_CCI400_PORT_CTRL
 
 config BRCMSTB_GISB_ARB
 	bool "Broadcom STB GISB bus arbiter"
+	depends on ARCH_BRCMSTB
 	depends on ARM || ARM64 || MIPS
 	default ARCH_BRCMSTB || BMIPS_GENERIC
 	help
drivers/power/reset/Kconfig +1 -0
index 651b763f80cd..6f0b1ed1a05a 100644
@@ -59,6 +59,7 @@ config POWER_RESET_BRCMKONA
 
 config POWER_RESET_BRCMSTB
 	bool "Broadcom STB reset driver"
+	depends on ARCH_BRCMSTB
 	depends on ARM || ARM64 || MIPS || COMPILE_TEST
 	depends on MFD_SYSCON
 	default ARCH_BRCMSTB || BMIPS_GENERIC
drivers/soc/bcm/Kconfig +1 -0
index 648e32693b7e..5a8ff33241ae 100644
@@ -24,6 +24,7 @@ config RASPBERRYPI_POWER
 
 config SOC_BRCMSTB
 	bool "Broadcom STB SoC drivers"
+	depends on ARCH_BRCMSTB
 	depends on ARM || ARM64 || BMIPS_GENERIC || COMPILE_TEST
 	select SOC_BUS
 	help
Signature · 1 line
2.17.1
#6 lore raw

PATCH 3/4 arm64: Kconfig: Fix VEXPRESS driver dependencies

In reply to Amit Kucheria

Push various VEXPRESS drivers behind ARCH_VEXPRESS dependency so that it doesn't get enabled by default on other platforms.

---
 drivers/bus/Kconfig           | 2 +-
 drivers/clk/versatile/Kconfig | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/bus/Kconfig +1 -1
index d80e8d70bf10..b2b1beee9953 100644
@@ -166,7 +166,7 @@ config UNIPHIER_SYSTEM_BUS
 
 config VEXPRESS_CONFIG
 	bool "Versatile Express configuration bus"
-	default y if ARCH_VEXPRESS
+	depends on ARCH_VEXPRESS
 	depends on ARM || ARM64
 	depends on OF
 	select REGMAP
drivers/clk/versatile/Kconfig +2 -2
index ac766855ba16..826750292c1e 100644
@@ -5,8 +5,8 @@ config ICST
 config COMMON_CLK_VERSATILE
 	bool "Clock driver for ARM Reference designs"
 	depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
-		ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
-		COMPILE_TEST
+		ARCH_VERSATILE || ARCH_VEXPRESS || COMPILE_TEST
+	depends on ARM64
 	select REGMAP_MMIO
 	---help---
           Supports clocking on ARM Reference designs:
Signature · 1 line
2.17.1
#10 lore raw

PATCH 4/4 arm64: Kconfig: Fix EXYNOS driver dependencies

In reply to Amit Kucheria

Push various EXYNOS drivers behind ARCH_EXYNOS dependency so that it doesn't get enabled by default on other platforms.

---
 drivers/clk/Kconfig       | 1 +
 drivers/regulator/Kconfig | 1 +
 2 files changed, 2 insertions(+)
drivers/clk/Kconfig +1 -0
index 9b2790d3f18a..bdf164a7a7c5 100644
@@ -194,6 +194,7 @@ config COMMON_CLK_ASPEED
 
 config COMMON_CLK_S2MPS11
 	tristate "Clock driver for S2MPS1X/S5M8767 MFD"
+	depends on ARCH_EXYNOS
 	depends on MFD_SEC_CORE || COMPILE_TEST
 	---help---
 	  This driver supports S2MPS11/S2MPS14/S5M8767 crystal oscillator
drivers/regulator/Kconfig +1 -0
index b57093d7c01f..a4c4f01343fd 100644
@@ -797,6 +797,7 @@ config REGULATOR_S2MPA01
 
 config REGULATOR_S2MPS11
 	tristate "Samsung S2MPS11/13/14/15/S2MPU02 voltage regulator"
+	depends on ARCH_EXYNOS
 	depends on MFD_SEC_CORE
 	help
 	 This driver supports a Samsung S2MPS11/13/14/15/S2MPU02 voltage
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Re: [PATCH 1/4] arm64: Kconfig: Fix XGENE driver dependencies

In reply to Amit Kucheria

Quoting Amit Kucheria (2019-09-11 15:18:45)

drivers/clk/Kconfig config CLK_QORIQ · line 229

Quoted 11 lines
drivers/clk/Kconfig +1 -1
index 801fa1cd0321..9b2790d3f18a 100644
@@ -225,7 +225,7 @@ config CLK_QORIQ
 
 config COMMON_CLK_XGENE
        bool "Clock driver for APM XGene SoC"
-       default ARCH_XGENE
+       depends on ARCH_XGENE
        depends on ARM64 || COMPILE_TEST

Is ARCH_XGENE supported outside of ARM64? I'd expect to see something more like depends on ARCH_XGENE || COMPILE_TEST and default ARCH_XGENE so that if the config is supported it becomes the default. Or at least depends on ARCH_XGENE && ARM64 || COMPILE_TEST

Quoted 2 lines
drivers/clk/Kconfig +0 -0
        ---help---
          Sypport for the APM X-Gene SoC reference, PLL, and device clocks.
#7 lore raw

Re: [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS driver dependencies

In reply to Amit Kucheria
Quoted 15 lines · Amit Kucheria

Push various VEXPRESS drivers behind ARCH_VEXPRESS dependency so that it doesn't get enabled by default on other platforms.

---
 drivers/bus/Kconfig           | 2 +-
 drivers/clk/versatile/Kconfig | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/bus/Kconfig +0 -0
index d80e8d70bf10..b2b1beee9953 100644

drivers/bus/Kconfig config UNIPHIER_SYSTEM_BUS · line 171

Quoted 7 lines
drivers/bus/Kconfig +1 -1
@@ -166,7 +166,7 @@ config UNIPHIER_SYSTEM_BUS
 
 config VEXPRESS_CONFIG
        bool "Versatile Express configuration bus"
-       default y if ARCH_VEXPRESS
+       depends on ARCH_VEXPRESS
        depends on ARM || ARM64
        depends on OF

Removing the 'default y' breaks existing defconfig files,

Adding the 'depends on ARCH_VEXPRESS' unnecessarily limits compile-testing. I'd rather extend it to other architectures than limit it to builds that have vexpress enabled.

drivers/clk/versatile/Kconfig config ICST · line 9

Quoted 12 lines
drivers/clk/versatile/Kconfig +2 -2
index ac766855ba16..826750292c1e 100644
@@ -5,8 +5,8 @@ config ICST
 config COMMON_CLK_VERSATILE
        bool "Clock driver for ARM Reference designs"
        depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
-               ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
-               COMPILE_TEST
+               ARCH_VERSATILE || ARCH_VEXPRESS || COMPILE_TEST
+       depends on ARM64

It's definitely wrong to limit this to 64 bit.

Arnd

#11 lore raw

Re: [PATCH 4/4] arm64: Kconfig: Fix EXYNOS driver dependencies

In reply to Amit Kucheria

drivers/clk/Kconfig config COMMON_CLK_ASPEED · line 200

Quoted 12 lines · Amit Kucheria
drivers/clk/Kconfig +1 -0
index 9b2790d3f18a..bdf164a7a7c5 100644
@@ -194,6 +194,7 @@ config COMMON_CLK_ASPEED
 
 config COMMON_CLK_S2MPS11
        tristate "Clock driver for S2MPS1X/S5M8767 MFD"
+       depends on ARCH_EXYNOS
        depends on MFD_SEC_CORE || COMPILE_TEST
        ---help---
          This driver supports S2MPS11/S2MPS14/S5M8767 crystal oscillator

This breaks compile-testing on non-ARM targets.

drivers/regulator/Kconfig config REGULATOR_S2MPA01 · line 803

Quoted 12 lines
drivers/regulator/Kconfig +1 -0
index b57093d7c01f..a4c4f01343fd 100644
@@ -797,6 +797,7 @@ config REGULATOR_S2MPA01
 
 config REGULATOR_S2MPS11
        tristate "Samsung S2MPS11/13/14/15/S2MPU02 voltage regulator"
+       depends on ARCH_EXYNOS
        depends on MFD_SEC_CORE
        help
         This driver supports a Samsung S2MPS11/13/14/15/S2MPU02 voltage

Same here. What you could do instead is add

        depends on ARCH_EXYNOS || COMPILE_TEST

to MFD_SEC_CORE, this would then propagate to these two drivers as well.

Arnd

#5 lore raw

Re: [PATCH 2/4] arm64: Kconfig: Fix BRCMSTB driver dependencies

In reply to Amit Kucheria

drivers/bus/Kconfig config ARM_CCI400_PORT_CTRL · line 28

Quoted 12 lines · Amit Kucheria
drivers/bus/Kconfig +1 -0
index 1851112ccc29..d80e8d70bf10 100644
@@ -22,6 +22,7 @@ config ARM_CCI400_PORT_CTRL
 
 config BRCMSTB_GISB_ARB
        bool "Broadcom STB GISB bus arbiter"
+       depends on ARCH_BRCMSTB
        depends on ARM || ARM64 || MIPS
        default ARCH_BRCMSTB || BMIPS_GENERIC
        help

This breaks MIPS configurations that need this driver, and it breask compile-testing on non-ARM/MIPS targets.

drivers/power/reset/Kconfig config POWER_RESET_BRCMKONA · line 65

Quoted 12 lines
drivers/power/reset/Kconfig +1 -0
index 651b763f80cd..6f0b1ed1a05a 100644
@@ -59,6 +59,7 @@ config POWER_RESET_BRCMKONA
 
 config POWER_RESET_BRCMSTB
        bool "Broadcom STB reset driver"
+       depends on ARCH_BRCMSTB
        depends on ARM || ARM64 || MIPS || COMPILE_TEST
        depends on MFD_SYSCON
        default ARCH_BRCMSTB || BMIPS_GENERIC

Same here and below.

drivers/soc/bcm/Kconfig config RASPBERRYPI_POWER · line 30

Quoted 12 lines
drivers/soc/bcm/Kconfig +1 -0
index 648e32693b7e..5a8ff33241ae 100644
@@ -24,6 +24,7 @@ config RASPBERRYPI_POWER
 
 config SOC_BRCMSTB
        bool "Broadcom STB SoC drivers"
+       depends on ARCH_BRCMSTB
        depends on ARM || ARM64 || BMIPS_GENERIC || COMPILE_TEST
        select SOC_BUS
        help

Arnd

#3 lore raw

Re: [PATCH 1/4] arm64: Kconfig: Fix XGENE driver dependencies

In reply to Amit Kucheria
Quoted 19 lines · Amit Kucheria

Push various XGENE drivers behind ARCH_XGENE dependency so that it doesn't get enabled by default on other platforms.

---
 arch/arm64/Kconfig.platforms   | 3 +++
 drivers/clk/Kconfig            | 2 +-
 drivers/gpio/Kconfig           | 1 +
 drivers/pci/controller/Kconfig | 1 +
 drivers/phy/Kconfig            | 1 +
 drivers/power/reset/Kconfig    | 2 +-
 6 files changed, 8 insertions(+), 2 deletions(-)
arch/arm64/Kconfig.platforms +0 -0
index 4778c775de1b..cdf4e452e34c 100644

arch/arm64/Kconfig.platforms config ARCH_VULCAN · line 288

Quoted 8 lines
arch/arm64/Kconfig.platforms +3 -0
@@ -281,6 +281,9 @@ config ARCH_VULCAN
 
 config ARCH_XGENE
        bool "AppliedMicro X-Gene SOC Family"
+       select COMMON_CLK_XGENE
+       select PCI_XGENE
+       select GPIO_XGENE
        help
          This enables support for AppliedMicro X-Gene SOC Family

I'd rather not 'select' drivers that might be optional, the 'default y' should be sufficient as long as it's in theory possible to have them disabled or as loadable modules.

drivers/clk/Kconfig config CLK_QORIQ · line 231

Quoted 13 lines
drivers/clk/Kconfig +1 -1
index 801fa1cd0321..9b2790d3f18a 100644
@@ -225,7 +225,7 @@ config CLK_QORIQ
 
 config COMMON_CLK_XGENE
        bool "Clock driver for APM XGene SoC"
-       default ARCH_XGENE
+       depends on ARCH_XGENE
        depends on ARM64 || COMPILE_TEST
        ---help---
          Sypport for the APM X-Gene SoC reference, PLL, and device clocks.

This breaks compile-testing, and existing defconfigs that don't list the driver.

Arnd

#13 lore raw
In reply to Amit Kucheria
Quoted 5 lines · Amit Kucheria

I was using initcall_debugging on a QCOM platform and ran across a bunch of driver initcalls that are enabled even if their SoC support is disabled.

Here are some fixups for a subset of them.

The idea seems reasonable, disabling a platform may just turn off all the drivers that are not useful elsewhere, but there are mistakes in a lot of your changes, so I'm certainly not applying these for 5.4.

Generally speaking, the way that works best is

config SUBSYS_DRIVER_FOO
tristate "SUBSYS support for FOO platform"
depends on ARCH_FOO || COMPILE_TEST
depends on SUBSYS
default "m" if ARCH_FOO

This means it's enabled as a loadable module by default (use default "y" instead where necessary) as long as the platform is enabled, but an x86 allmodconfig build also includes it because of COMPILE_TEST, while any configuration without ARCH_FOO that is not compile-testing cannot enable it.

Arnd

maintainer
#12 lore raw

Re: [PATCH 4/4] arm64: Kconfig: Fix EXYNOS driver dependencies

In reply to Amit Kucheria

drivers/regulator/Kconfig config REGULATOR_S2MPA01 · line 803

Quoted 9 lines · Amit Kucheria

Push various EXYNOS drivers behind ARCH_EXYNOS dependency so that it doesn't get enabled by default on other platforms.

config REGULATOR_S2MPS11

drivers/regulator/Kconfig +1 -0
 	tristate "Samsung S2MPS11/13/14/15/S2MPU02 voltage regulator"
+	depends on ARCH_EXYNOS
 	depends on MFD_SEC_CORE
 	help
 	 This driver supports a Samsung S2MPS11/13/14/15/S2MPU02 voltage

This doesn't match the changelog at all. This driver is not enabled by default since it's just a normal tristate, they are disabled by default. As far as I can see all this change will do is reduce our build test coverage by adding an artificial dependency without an || COMPILE_TEST.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#16 lore raw
In reply to Amit Kucheria
Quoted 2 lines · Amit Kucheria

I was using initcall_debugging on a QCOM platform and ran across a bunch of driver initcalls that are enabled even if their SoC support is disabled.

What exactly is the problem you're trying to fix here? For the drivers I looked at these were bog standard register the driver with the subsystem type initcalls on optional drivers so not doing anything particularly disruptive or anything like that. For any given system that's going to be an issue for the overwhelming majority of drivers on the tree, including those that aren't associated with any particular architecture.

#14 lore raw
In reply to Arnd Bergmann

Hi Arnd,

Quoted 11 lines · Arnd Bergmann
Quoted 5 lines · Amit Kucheria

I was using initcall_debugging on a QCOM platform and ran across a bunch of driver initcalls that are enabled even if their SoC support is disabled.

Here are some fixups for a subset of them.

The idea seems reasonable, disabling a platform may just turn off all the drivers that are not useful elsewhere, but there are mistakes in a lot of your changes, so I'm certainly not applying these for 5.4.

OK, thanks for confirming that you have no objections to such changes, per-se.

I'll spend some more time ensuring COMPILE_TEST coverage for these cleanups. I only focused on quickly cleaning up my initcall_debug output for now.

Quoted 8 lines

Generally speaking, the way that works best is

config SUBSYS_DRIVER_FOO
tristate "SUBSYS support for FOO platform"
depends on ARCH_FOO || COMPILE_TEST
depends on SUBSYS
default "m" if ARCH_FOO

Quoted 5 lines

This means it's enabled as a loadable module by default (use default "y" instead where necessary) as long as the platform is enabled, but an x86 allmodconfig build also includes it because of COMPILE_TEST, while any configuration without ARCH_FOO that is not compile-testing cannot enable it.

How would you like to handle defconfigs which list a driver explicitly? Should we add ARCH_FOO to those defconfigs or remove DRIVER_FOO from them?

Regards,
Amit

maintainer
#15 lore raw
In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

Generally speaking, the way that works best is

config SUBSYS_DRIVER_FOO
tristate "SUBSYS support for FOO platform" depends on ARCH_FOO || COMPILE_TEST
depends on SUBSYS
default "m" if ARCH_FOO

Quoted 5 lines

This means it's enabled as a loadable module by default (use default "y" instead where necessary) as long as the platform is enabled, but an x86 allmodconfig build also includes it because of COMPILE_TEST, while any configuration without ARCH_FOO that is not compile-testing cannot enable it.

Indeed, though we shouldn't be adding any default m/y to things that don't already default on.

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#17 lore raw
In reply to Mark Brown
Quoted 10 lines · Mark Brown
Quoted 2 lines · Amit Kucheria

I was using initcall_debugging on a QCOM platform and ran across a bunch of driver initcalls that are enabled even if their SoC support is disabled.

What exactly is the problem you're trying to fix here? For the drivers I looked at these were bog standard register the driver with the subsystem type initcalls on optional drivers so not doing anything particularly disruptive or anything like that.

I was trying to prune the defconfig only to drivers that make sense on the SoC. e.g. Why should I see a brcmstb_soc_device_early_init() call on a QCOM system when I've disabled ARCH_BRCMSTB?

I came across this while trying to figure out how to make thermal and cpufreq frameworks initialise as early as possible.

Quoted 3 lines

For any given system that's going to be an issue for the overwhelming majority of drivers on the tree, including those that aren't associated with any particular architecture.

Indeed. From a quick check, MFD and GPIO has a bunch of 'generic' drivers that aren't SoC-specific. I'm sure there are several such drivers in regulator framework too. They don't need to be 'fixed'.

I was just trying to ring-fence obvious SoC-specific drivers behind a ARCH_FOO dependency since they seemed like low-hanging fruit. Let me know if it isn't a good use of everyone's time.

Regards,
Amit

maintainer
#18 lore raw
Quoted 5 lines · Amit Kucheria
Quoted 2 lines · Mark Brown
Quoted 2 lines

I was using initcall_debugging on a QCOM platform and ran across a bunch of driver initcalls that are enabled even if their SoC support is disabled.

Quoted 8 lines
Quoted 4 lines

What exactly is the problem you're trying to fix here? For the drivers I looked at these were bog standard register the driver with the subsystem type initcalls on optional drivers so not doing anything particularly disruptive or anything like that.

I was trying to prune the defconfig only to drivers that make sense on the SoC. e.g. Why should I see a brcmstb_soc_device_early_init() call on a QCOM system when I've disabled ARCH_BRCMSTB?

So this is really just the standard make Kconfig easier to use by filtering out noise thing. It'd be clearer if you said that in the changelog, and like the review comments have been saying you need to leave in an || COMPILE_TEST in there otherwise it's actively harmful.

Quoted 2 lines

I came across this while trying to figure out how to make thermal and cpufreq frameworks initialise as early as possible.

AFAICT you'd also have been happy if you just built these drivers modular?

#8 lore raw

Re: [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS driver dependencies

In reply to Amit Kucheria
Quoted 3 lines · Amit Kucheria

Push various VEXPRESS drivers behind ARCH_VEXPRESS dependency so that it doesn't get enabled by default on other platforms.

I couldn't understand the motivation for these changes from the cover letter.

Quoted 24 lines
---
 drivers/bus/Kconfig           | 2 +-
 drivers/clk/versatile/Kconfig | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/bus/Kconfig +1 -1
index d80e8d70bf10..b2b1beee9953 100644
@@ -166,7 +166,7 @@ config UNIPHIER_SYSTEM_BUS
 
 config VEXPRESS_CONFIG
 	bool "Versatile Express configuration bus"
-	default y if ARCH_VEXPRESS
+	depends on ARCH_VEXPRESS
 	depends on ARM || ARM64
 	depends on OF
 	select REGMAP
drivers/clk/versatile/Kconfig +0 -0
index ac766855ba16..826750292c1e 100644

drivers/clk/versatile/Kconfig config ICST · line 9

Quoted 7 lines
drivers/clk/versatile/Kconfig +2 -2
@@ -5,8 +5,8 @@ config ICST
 config COMMON_CLK_VERSATILE
 	bool "Clock driver for ARM Reference designs"
 	depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
-		ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
-		COMPILE_TEST
+		ARCH_VERSATILE || ARCH_VEXPRESS || COMPILE_TEST
+	depends on ARM64

This will break 32-bit platforms.

--
Regards,
Sudeep

#9 lore raw

Re: [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS driver dependencies

Quoted 7 lines · Sudeep Holla
Quoted 3 lines · Amit Kucheria

Push various VEXPRESS drivers behind ARCH_VEXPRESS dependency so that it doesn't get enabled by default on other platforms.

I couldn't understand the motivation for these changes from the cover letter.

Yes, the cover letter for this series needs to be a lot better. Sorry. In summary, I found a bunch of drivers in defconfig that were getting called in early_initcall and core_initcall even when the platform or COMPILE_TEST was not enabled. So I was just trying to ring fence some of those drivers as a proof of concept to see if these changes were acceptable upstream.

Let me try again with a better cover letter and using the pattern Arnd suggested elsewhere.

Quoted 37 lines
Quoted 24 lines
---
 drivers/bus/Kconfig           | 2 +-
 drivers/clk/versatile/Kconfig | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/bus/Kconfig +1 -1
index d80e8d70bf10..b2b1beee9953 100644
@@ -166,7 +166,7 @@ config UNIPHIER_SYSTEM_BUS
 
 config VEXPRESS_CONFIG
      bool "Versatile Express configuration bus"
-     default y if ARCH_VEXPRESS
+     depends on ARCH_VEXPRESS
      depends on ARM || ARM64
      depends on OF
      select REGMAP
drivers/clk/versatile/Kconfig +0 -0
index ac766855ba16..826750292c1e 100644

drivers/clk/versatile/Kconfig config ICST · line 9

Quoted 7 lines
drivers/clk/versatile/Kconfig +2 -2
@@ -5,8 +5,8 @@ config ICST
 config COMMON_CLK_VERSATILE
      bool "Clock driver for ARM Reference designs"
      depends on ARCH_INTEGRATOR || ARCH_REALVIEW || \
-             ARCH_VERSATILE || ARCH_VEXPRESS || ARM64 || \
-             COMPILE_TEST
+             ARCH_VERSATILE || ARCH_VEXPRESS || COMPILE_TEST
+     depends on ARM64

This will break 32-bit platforms.

--
Regards,
Sudeep