linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Cleanup arm64 driver dependencies
@ 2019-09-11 22:18 Amit Kucheria
  2019-09-11 22:18 ` [PATCH 1/4] arm64: Kconfig: Fix XGENE " Amit Kucheria
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Amit Kucheria @ 2019-09-11 22:18 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, arm, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon
  Cc: linux-clk, linux-gpio, linux-pci, linux-pm

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

-- 
2.17.1


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

* [PATCH 1/4] arm64: Kconfig: Fix XGENE driver dependencies
  2019-09-11 22:18 [PATCH 0/4] Cleanup arm64 driver dependencies Amit Kucheria
@ 2019-09-11 22:18 ` Amit Kucheria
  2019-09-12  1:03   ` Stephen Boyd
  2019-09-12  9:23   ` Arnd Bergmann
  2019-09-11 22:18 ` [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS " Amit Kucheria
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 17+ messages in thread
From: Amit Kucheria @ 2019-09-11 22:18 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, arm, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon
  Cc: linux-clk, linux-gpio, linux-pci, linux-pm

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

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
---
 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(-)

diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
index 4778c775de1b..cdf4e452e34c 100644
--- a/arch/arm64/Kconfig.platforms
+++ b/arch/arm64/Kconfig.platforms
@@ -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
 
diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 801fa1cd0321..9b2790d3f18a 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -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.
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index bb13c266c329..072c749c5c1f 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -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
diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig
index fe9f9f13ce11..44699f45784f 100644
--- a/drivers/pci/controller/Kconfig
+++ b/drivers/pci/controller/Kconfig
@@ -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.
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index 0263db2ac874..7c5eefecdabd 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -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
diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index a564237278ff..651b763f80cd 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -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.
 
-- 
2.17.1


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

* [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS driver dependencies
  2019-09-11 22:18 [PATCH 0/4] Cleanup arm64 driver dependencies Amit Kucheria
  2019-09-11 22:18 ` [PATCH 1/4] arm64: Kconfig: Fix XGENE " Amit Kucheria
@ 2019-09-11 22:18 ` Amit Kucheria
  2019-09-12  9:17   ` Arnd Bergmann
  2019-09-13 10:12   ` Sudeep Holla
  2019-09-11 22:18 ` [PATCH 4/4] arm64: Kconfig: Fix EXYNOS " Amit Kucheria
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 17+ messages in thread
From: Amit Kucheria @ 2019-09-11 22:18 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, arm, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon
  Cc: linux-clk

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

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
---
 drivers/bus/Kconfig           | 2 +-
 drivers/clk/versatile/Kconfig | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index d80e8d70bf10..b2b1beee9953 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -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
diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
index ac766855ba16..826750292c1e 100644
--- a/drivers/clk/versatile/Kconfig
+++ b/drivers/clk/versatile/Kconfig
@@ -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:
-- 
2.17.1


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

* [PATCH 4/4] arm64: Kconfig: Fix EXYNOS driver dependencies
  2019-09-11 22:18 [PATCH 0/4] Cleanup arm64 driver dependencies Amit Kucheria
  2019-09-11 22:18 ` [PATCH 1/4] arm64: Kconfig: Fix XGENE " Amit Kucheria
  2019-09-11 22:18 ` [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS " Amit Kucheria
@ 2019-09-11 22:18 ` Amit Kucheria
  2019-09-12  9:19   ` Arnd Bergmann
  2019-09-12  9:32   ` Mark Brown
  2019-09-12  9:29 ` [PATCH 0/4] Cleanup arm64 " Arnd Bergmann
  2019-09-12  9:46 ` Mark Brown
  4 siblings, 2 replies; 17+ messages in thread
From: Amit Kucheria @ 2019-09-11 22:18 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, arm, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon
  Cc: linux-clk

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

Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
---
 drivers/clk/Kconfig       | 1 +
 drivers/regulator/Kconfig | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
index 9b2790d3f18a..bdf164a7a7c5 100644
--- a/drivers/clk/Kconfig
+++ b/drivers/clk/Kconfig
@@ -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
diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
index b57093d7c01f..a4c4f01343fd 100644
--- a/drivers/regulator/Kconfig
+++ b/drivers/regulator/Kconfig
@@ -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
-- 
2.17.1


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

* Re: [PATCH 1/4] arm64: Kconfig: Fix XGENE driver dependencies
  2019-09-11 22:18 ` [PATCH 1/4] arm64: Kconfig: Fix XGENE " Amit Kucheria
@ 2019-09-12  1:03   ` Stephen Boyd
  2019-09-12  9:23   ` Arnd Bergmann
  1 sibling, 0 replies; 17+ messages in thread
From: Stephen Boyd @ 2019-09-12  1:03 UTC (permalink / raw)
  To: Amit Kucheria, Bartosz Golaszewski, Catalin Marinas,
	Kishon Vijay Abraham I, Liam Girdwood, Linus Walleij,
	Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Will Deacon, arm, linux-arm-kernel,
	linux-kernel
  Cc: linux-clk, linux-gpio, linux-pci, linux-pm

Quoting Amit Kucheria (2019-09-11 15:18:45)
> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
> index 801fa1cd0321..9b2790d3f18a 100644
> --- a/drivers/clk/Kconfig
> +++ b/drivers/clk/Kconfig
> @@ -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

>         ---help---
>           Sypport for the APM X-Gene SoC reference, PLL, and device clocks.

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

* Re: [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS driver dependencies
  2019-09-11 22:18 ` [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS " Amit Kucheria
@ 2019-09-12  9:17   ` Arnd Bergmann
  2019-09-13 10:12   ` Sudeep Holla
  1 sibling, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2019-09-12  9:17 UTC (permalink / raw)
  To: Amit Kucheria
  Cc: linux-kernel, Linux ARM, arm-soc, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon, linux-clk

On Thu, Sep 12, 2019 at 12:19 AM Amit Kucheria <amit.kucheria@linaro.org> wrote:
>
> Push various VEXPRESS drivers behind ARCH_VEXPRESS dependency so that it
> doesn't get enabled by default on other platforms.
>
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> ---
>  drivers/bus/Kconfig           | 2 +-
>  drivers/clk/versatile/Kconfig | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
> index d80e8d70bf10..b2b1beee9953 100644
> --- a/drivers/bus/Kconfig
> +++ b/drivers/bus/Kconfig
> @@ -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.

> diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> index ac766855ba16..826750292c1e 100644
> --- a/drivers/clk/versatile/Kconfig
> +++ b/drivers/clk/versatile/Kconfig
> @@ -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

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

* Re: [PATCH 4/4] arm64: Kconfig: Fix EXYNOS driver dependencies
  2019-09-11 22:18 ` [PATCH 4/4] arm64: Kconfig: Fix EXYNOS " Amit Kucheria
@ 2019-09-12  9:19   ` Arnd Bergmann
  2019-09-12  9:32   ` Mark Brown
  1 sibling, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2019-09-12  9:19 UTC (permalink / raw)
  To: Amit Kucheria
  Cc: linux-kernel, Linux ARM, arm-soc, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon, linux-clk

On Thu, Sep 12, 2019 at 12:19 AM Amit Kucheria <amit.kucheria@linaro.org> wrote:

> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
> index 9b2790d3f18a..bdf164a7a7c5 100644
> --- a/drivers/clk/Kconfig
> +++ b/drivers/clk/Kconfig
> @@ -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.

> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig
> index b57093d7c01f..a4c4f01343fd 100644
> --- a/drivers/regulator/Kconfig
> +++ b/drivers/regulator/Kconfig
> @@ -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

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

* Re: [PATCH 1/4] arm64: Kconfig: Fix XGENE driver dependencies
  2019-09-11 22:18 ` [PATCH 1/4] arm64: Kconfig: Fix XGENE " Amit Kucheria
  2019-09-12  1:03   ` Stephen Boyd
@ 2019-09-12  9:23   ` Arnd Bergmann
  1 sibling, 0 replies; 17+ messages in thread
From: Arnd Bergmann @ 2019-09-12  9:23 UTC (permalink / raw)
  To: Amit Kucheria
  Cc: linux-kernel, Linux ARM, arm-soc, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon, linux-clk,
	open list:GPIO SUBSYSTEM, linux-pci, Linux PM list

On Thu, Sep 12, 2019 at 12:19 AM Amit Kucheria <amit.kucheria@linaro.org> wrote:
>
> Push various XGENE drivers behind ARCH_XGENE dependency so that it
> doesn't get enabled by default on other platforms.
>
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> ---
>  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(-)
>
> diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms
> index 4778c775de1b..cdf4e452e34c 100644
> --- a/arch/arm64/Kconfig.platforms
> +++ b/arch/arm64/Kconfig.platforms
> @@ -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.

> diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig
> index 801fa1cd0321..9b2790d3f18a 100644
> --- a/drivers/clk/Kconfig
> +++ b/drivers/clk/Kconfig
> @@ -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

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

* Re: [PATCH 0/4] Cleanup arm64 driver dependencies
  2019-09-11 22:18 [PATCH 0/4] Cleanup arm64 driver dependencies Amit Kucheria
                   ` (2 preceding siblings ...)
  2019-09-11 22:18 ` [PATCH 4/4] arm64: Kconfig: Fix EXYNOS " Amit Kucheria
@ 2019-09-12  9:29 ` Arnd Bergmann
  2019-09-12  9:47   ` Amit Kucheria
  2019-09-12 10:03   ` Mark Brown
  2019-09-12  9:46 ` Mark Brown
  4 siblings, 2 replies; 17+ messages in thread
From: Arnd Bergmann @ 2019-09-12  9:29 UTC (permalink / raw)
  To: Amit Kucheria
  Cc: linux-kernel, Linux ARM, arm-soc, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon, linux-clk,
	open list:GPIO SUBSYSTEM, linux-pci, Linux PM list

On Thu, Sep 12, 2019 at 12:18 AM Amit Kucheria <amit.kucheria@linaro.org> wrote:
>
> 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

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

* Re: [PATCH 4/4] arm64: Kconfig: Fix EXYNOS driver dependencies
  2019-09-11 22:18 ` [PATCH 4/4] arm64: Kconfig: Fix EXYNOS " Amit Kucheria
  2019-09-12  9:19   ` Arnd Bergmann
@ 2019-09-12  9:32   ` Mark Brown
  1 sibling, 0 replies; 17+ messages in thread
From: Mark Brown @ 2019-09-12  9:32 UTC (permalink / raw)
  To: Amit Kucheria
  Cc: linux-kernel, linux-arm-kernel, arm, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon, linux-clk

[-- Attachment #1: Type: text/plain, Size: 704 bytes --]

On Thu, Sep 12, 2019 at 03:48:48AM +0530, Amit Kucheria wrote:

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

>  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

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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 0/4] Cleanup arm64 driver dependencies
  2019-09-11 22:18 [PATCH 0/4] Cleanup arm64 driver dependencies Amit Kucheria
                   ` (3 preceding siblings ...)
  2019-09-12  9:29 ` [PATCH 0/4] Cleanup arm64 " Arnd Bergmann
@ 2019-09-12  9:46 ` Mark Brown
  2019-09-12 10:03   ` Amit Kucheria
  4 siblings, 1 reply; 17+ messages in thread
From: Mark Brown @ 2019-09-12  9:46 UTC (permalink / raw)
  To: Amit Kucheria
  Cc: linux-kernel, linux-arm-kernel, arm, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon, linux-clk,
	linux-gpio, linux-pci, linux-pm

[-- Attachment #1: Type: text/plain, Size: 645 bytes --]

On Thu, Sep 12, 2019 at 03:48:44AM +0530, Amit Kucheria wrote:

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 0/4] Cleanup arm64 driver dependencies
  2019-09-12  9:29 ` [PATCH 0/4] Cleanup arm64 " Arnd Bergmann
@ 2019-09-12  9:47   ` Amit Kucheria
  2019-09-12 10:03   ` Mark Brown
  1 sibling, 0 replies; 17+ messages in thread
From: Amit Kucheria @ 2019-09-12  9:47 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: linux-kernel, Linux ARM, arm-soc, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon, linux-clk,
	open list:GPIO SUBSYSTEM, linux-pci, Linux PM list

Hi Arnd,

On Thu, Sep 12, 2019 at 2:59 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Thu, Sep 12, 2019 at 12:18 AM Amit Kucheria <amit.kucheria@linaro.org> wrote:
> >
> > 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.

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

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

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

* Re: [PATCH 0/4] Cleanup arm64 driver dependencies
  2019-09-12  9:29 ` [PATCH 0/4] Cleanup arm64 " Arnd Bergmann
  2019-09-12  9:47   ` Amit Kucheria
@ 2019-09-12 10:03   ` Mark Brown
  1 sibling, 0 replies; 17+ messages in thread
From: Mark Brown @ 2019-09-12 10:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Amit Kucheria, linux-kernel, Linux ARM, arm-soc,
	Bartosz Golaszewski, Catalin Marinas, Kishon Vijay Abraham I,
	Liam Girdwood, Linus Walleij, Lorenzo Pieralisi,
	Michael Turquette, Sebastian Reichel, Stephen Boyd, Will Deacon,
	linux-clk, open list:GPIO SUBSYSTEM, linux-pci, Linux PM list

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

On Thu, Sep 12, 2019 at 11:29:00AM +0200, Arnd Bergmann wrote:

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

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 0/4] Cleanup arm64 driver dependencies
  2019-09-12  9:46 ` Mark Brown
@ 2019-09-12 10:03   ` Amit Kucheria
  2019-09-12 10:53     ` Mark Brown
  0 siblings, 1 reply; 17+ messages in thread
From: Amit Kucheria @ 2019-09-12 10:03 UTC (permalink / raw)
  To: Mark Brown
  Cc: Linux Kernel Mailing List, Lists LAKML, arm-soc,
	Bartosz Golaszewski, Catalin Marinas, Kishon Vijay Abraham I,
	Liam Girdwood, Linus Walleij, Lorenzo Pieralisi,
	Michael Turquette, Sebastian Reichel, Stephen Boyd, Will Deacon,
	linux-clk, open list:GPIO SUBSYSTEM, linux-pci, Linux PM list

On Thu, Sep 12, 2019 at 3:17 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Thu, Sep 12, 2019 at 03:48:44AM +0530, Amit Kucheria wrote:
>
> > 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.

> 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

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

* Re: [PATCH 0/4] Cleanup arm64 driver dependencies
  2019-09-12 10:03   ` Amit Kucheria
@ 2019-09-12 10:53     ` Mark Brown
  0 siblings, 0 replies; 17+ messages in thread
From: Mark Brown @ 2019-09-12 10:53 UTC (permalink / raw)
  To: Amit Kucheria
  Cc: Linux Kernel Mailing List, Lists LAKML, arm-soc,
	Bartosz Golaszewski, Catalin Marinas, Kishon Vijay Abraham I,
	Liam Girdwood, Linus Walleij, Lorenzo Pieralisi,
	Michael Turquette, Sebastian Reichel, Stephen Boyd, Will Deacon,
	linux-clk, open list:GPIO SUBSYSTEM, linux-pci, Linux PM list

[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]

On Thu, Sep 12, 2019 at 03:33:20PM +0530, Amit Kucheria wrote:
> On Thu, Sep 12, 2019 at 3:17 PM Mark Brown <broonie@kernel.org> wrote:

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

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.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS driver dependencies
  2019-09-11 22:18 ` [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS " Amit Kucheria
  2019-09-12  9:17   ` Arnd Bergmann
@ 2019-09-13 10:12   ` Sudeep Holla
  2019-09-20 20:12     ` Amit Kucheria
  1 sibling, 1 reply; 17+ messages in thread
From: Sudeep Holla @ 2019-09-13 10:12 UTC (permalink / raw)
  To: Amit Kucheria
  Cc: linux-kernel, linux-arm-kernel, arm, Bartosz Golaszewski,
	Catalin Marinas, Kishon Vijay Abraham I, Liam Girdwood,
	Linus Walleij, Lorenzo Pieralisi, Mark Brown, Michael Turquette,
	Sebastian Reichel, Stephen Boyd, Will Deacon, linux-clk,
	Sudeep Holla

On Thu, Sep 12, 2019 at 03:48:47AM +0530, Amit Kucheria wrote:
> 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.

> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> ---
>  drivers/bus/Kconfig           | 2 +-
>  drivers/clk/versatile/Kconfig | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
> index d80e8d70bf10..b2b1beee9953 100644
> --- a/drivers/bus/Kconfig
> +++ b/drivers/bus/Kconfig
> @@ -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
> diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> index ac766855ba16..826750292c1e 100644
> --- a/drivers/clk/versatile/Kconfig
> +++ b/drivers/clk/versatile/Kconfig
> @@ -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

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

* Re: [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS driver dependencies
  2019-09-13 10:12   ` Sudeep Holla
@ 2019-09-20 20:12     ` Amit Kucheria
  0 siblings, 0 replies; 17+ messages in thread
From: Amit Kucheria @ 2019-09-20 20:12 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: Linux Kernel Mailing List, Lists LAKML, arm-soc,
	Bartosz Golaszewski, Catalin Marinas, Kishon Vijay Abraham I,
	Liam Girdwood, Linus Walleij, Lorenzo Pieralisi, Mark Brown,
	Michael Turquette, Sebastian Reichel, Stephen Boyd, Will Deacon,
	linux-clk

On Fri, Sep 13, 2019 at 3:12 AM Sudeep Holla <sudeep.holla@arm.com> wrote:
>
> On Thu, Sep 12, 2019 at 03:48:47AM +0530, Amit Kucheria wrote:
> > 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.

> > Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> > ---
> >  drivers/bus/Kconfig           | 2 +-
> >  drivers/clk/versatile/Kconfig | 4 ++--
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
> > index d80e8d70bf10..b2b1beee9953 100644
> > --- a/drivers/bus/Kconfig
> > +++ b/drivers/bus/Kconfig
> > @@ -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
> > diff --git a/drivers/clk/versatile/Kconfig b/drivers/clk/versatile/Kconfig
> > index ac766855ba16..826750292c1e 100644
> > --- a/drivers/clk/versatile/Kconfig
> > +++ b/drivers/clk/versatile/Kconfig
> > @@ -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

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

end of thread, other threads:[~2019-09-20 20:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-11 22:18 [PATCH 0/4] Cleanup arm64 driver dependencies Amit Kucheria
2019-09-11 22:18 ` [PATCH 1/4] arm64: Kconfig: Fix XGENE " Amit Kucheria
2019-09-12  1:03   ` Stephen Boyd
2019-09-12  9:23   ` Arnd Bergmann
2019-09-11 22:18 ` [PATCH 3/4] arm64: Kconfig: Fix VEXPRESS " Amit Kucheria
2019-09-12  9:17   ` Arnd Bergmann
2019-09-13 10:12   ` Sudeep Holla
2019-09-20 20:12     ` Amit Kucheria
2019-09-11 22:18 ` [PATCH 4/4] arm64: Kconfig: Fix EXYNOS " Amit Kucheria
2019-09-12  9:19   ` Arnd Bergmann
2019-09-12  9:32   ` Mark Brown
2019-09-12  9:29 ` [PATCH 0/4] Cleanup arm64 " Arnd Bergmann
2019-09-12  9:47   ` Amit Kucheria
2019-09-12 10:03   ` Mark Brown
2019-09-12  9:46 ` Mark Brown
2019-09-12 10:03   ` Amit Kucheria
2019-09-12 10:53     ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).