linux-pm.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
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ 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] 12+ 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 2/4] arm64: Kconfig: Fix BRCMSTB " Amit Kucheria
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 12+ 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] 12+ messages in thread

* [PATCH 2/4] arm64: Kconfig: Fix BRCMSTB 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:20   ` Arnd Bergmann
  2019-09-12  9:29 ` [PATCH 0/4] Cleanup arm64 " Arnd Bergmann
  2019-09-12  9:46 ` Mark Brown
  3 siblings, 1 reply; 12+ 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-pm

Push various BRCMSTB drivers behind ARCH_BRCMSTB 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         | 1 +
 drivers/power/reset/Kconfig | 1 +
 drivers/soc/bcm/Kconfig     | 1 +
 3 files changed, 3 insertions(+)

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 1851112ccc29..d80e8d70bf10 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -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
diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 651b763f80cd..6f0b1ed1a05a 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -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
diff --git a/drivers/soc/bcm/Kconfig b/drivers/soc/bcm/Kconfig
index 648e32693b7e..5a8ff33241ae 100644
--- a/drivers/soc/bcm/Kconfig
+++ b/drivers/soc/bcm/Kconfig
@@ -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
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 12+ 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; 12+ 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] 12+ messages in thread

* Re: [PATCH 2/4] arm64: Kconfig: Fix BRCMSTB driver dependencies
  2019-09-11 22:18 ` [PATCH 2/4] arm64: Kconfig: Fix BRCMSTB " Amit Kucheria
@ 2019-09-12  9:20   ` Arnd Bergmann
  0 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2019-09-12  9:20 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 PM list

On Thu, Sep 12, 2019 at 12:19 AM Amit Kucheria <amit.kucheria@linaro.org> wrote:
> diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
> index 1851112ccc29..d80e8d70bf10 100644
> --- a/drivers/bus/Kconfig
> +++ b/drivers/bus/Kconfig
> @@ -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.

> diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
> index 651b763f80cd..6f0b1ed1a05a 100644
> --- a/drivers/power/reset/Kconfig
> +++ b/drivers/power/reset/Kconfig
> @@ -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.

> diff --git a/drivers/soc/bcm/Kconfig b/drivers/soc/bcm/Kconfig
> index 648e32693b7e..5a8ff33241ae 100644
> --- a/drivers/soc/bcm/Kconfig
> +++ b/drivers/soc/bcm/Kconfig
> @@ -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

^ permalink raw reply	[flat|nested] 12+ 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; 12+ 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] 12+ 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
  2019-09-11 22:18 ` [PATCH 1/4] arm64: Kconfig: Fix XGENE " Amit Kucheria
  2019-09-11 22:18 ` [PATCH 2/4] arm64: Kconfig: Fix BRCMSTB " 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
  3 siblings, 2 replies; 12+ 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] 12+ 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-12  9:29 ` [PATCH 0/4] Cleanup arm64 " Arnd Bergmann
@ 2019-09-12  9:46 ` Mark Brown
  2019-09-12 10:03   ` Amit Kucheria
  3 siblings, 1 reply; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ 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; 12+ 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] 12+ messages in thread

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

Thread overview: 12+ 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 2/4] arm64: Kconfig: Fix BRCMSTB " Amit Kucheria
2019-09-12  9:20   ` Arnd Bergmann
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).