linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] bus: remove unused modular code from non-modular drivers
@ 2016-07-03 17:30 Paul Gortmaker
  2016-07-03 17:30 ` [PATCH 1/4] bus: brcmstb_gisb: make it explicitly non-modular Paul Gortmaker
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Paul Gortmaker @ 2016-07-03 17:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Alexandre Courbot, Alison Chaiken, Brian Norris,
	Florian Fainelli, Geert Uytterhoeven, Gregory Fong, Jon Hunter,
	Kevin Hilman, Sascha Hauer, Shawn Guo, Simon Horman,
	Stephen Warren, Thierry Reding, Wolfram Sang, linux-arm-kernel,
	linux-tegra

The drivers/bus doesn't have a strict maintainer entry, but since
all the changes here are for ARM platforms, I'm Cc'ing arm-kernel
and hoping it makes sense to vector these few changes through the
arm-soc tree.

My ongoing audit looking for non-modular code that needlessly uses
modular macros (vs. built-in equivalents) and/or has dead code
relating to module unloading that can never be executed led to the
creation of these four commits.

Two are of the trivial kind, where we substitute in the non-modular
versions that CPP would have put in place anyway, resulting in no
actual changes, even at the binary output level.

Another is of the kind where there was a ".remove" function
registered into the driver struct.  Being non-modular, these
functions will never be called via a normal module_exit path.

However, since it was possible (but largely pointless, and without
a real use case) to unbind these drivers via sysfs, we explicitly
disallow the unbind as part of the removal of the ".remove" itself.

Finally one is a conversion of a bool to a tristate; not something
I'd do myself by default, but in this case we had a desire from
the original author to have it that way.

For anyone new to the underlying goal of this cleanup, we are trying to
not use module support for code that can never be built as a module since:

 (1) it is easy to accidentally write unused module_exit and remove code
 (2) it can be misleading when reading the source, thinking it can be
     modular when the Makefile and/or Kconfig prohibit it
 (3) it requires the include of the module.h header file which in turn
     includes nearly everything else, thus adding to CPP overhead.
 (4) it gets copied/replicated into other code and spreads like weeds.

Build tested for arm and arm64 on linux-next to ensure no silly typos
that would break compilation crept in.

---

[v2: drop arm-ccn patch; it is being made tristate elsewhere, convert
 simple-pm to tristate, add new patch for new tegra-aconnect driver.]

[v1: https://lkml.kernel.org/r/1459113058-14340-1-git-send-email-paul.gortmaker@windriver.com ]

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Alison Chaiken <alison_chaiken@mentor.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Gregory Fong <gregory.0xf0@gmail.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawn.guo@linaro.org>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-tegra@vger.kernel.org

Paul Gortmaker (4):
  bus: brcmstb_gisb: make it explicitly non-modular
  bus: imx-weim: make it explicitly non-modular
  bus: tegra-aconnect: make it explicitly non-modular
  bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate

 drivers/bus/Kconfig          |  2 +-
 drivers/bus/brcmstb_gisb.c   |  4 +---
 drivers/bus/imx-weim.c       |  9 ++-------
 drivers/bus/tegra-aconnect.c | 22 +++++-----------------
 4 files changed, 9 insertions(+), 28 deletions(-)

-- 
2.8.4

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

* [PATCH 1/4] bus: brcmstb_gisb: make it explicitly non-modular
  2016-07-03 17:30 [PATCH v2 0/4] bus: remove unused modular code from non-modular drivers Paul Gortmaker
@ 2016-07-03 17:30 ` Paul Gortmaker
  2016-07-14 22:34   ` Florian Fainelli
  2016-07-03 17:30 ` [PATCH 2/4] bus: imx-weim: " Paul Gortmaker
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Paul Gortmaker @ 2016-07-03 17:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Brian Norris, Gregory Fong, Florian Fainelli,
	linux-arm-kernel

The Kconfig for this driver is currently:

config BRCMSTB_GISB_ARB
        bool "Broadcom STB GISB bus arbiter"

...meaning that it currently is not being built as a module by anyone.
Lets remove all modular references, so that when reading the driver
there is no doubt it is builtin-only.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

Cc: Brian Norris <computersforpeace@gmail.com>
Acked-by: Brian Norris <computersforpeace@gmail.com>
Cc: Gregory Fong <gregory.0xf0@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/bus/brcmstb_gisb.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/bus/brcmstb_gisb.c b/drivers/bus/brcmstb_gisb.c
index 72fe0a5a8bf3..2616d8208777 100644
--- a/drivers/bus/brcmstb_gisb.c
+++ b/drivers/bus/brcmstb_gisb.c
@@ -13,7 +13,6 @@
 
 #include <linux/init.h>
 #include <linux/types.h>
-#include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/sysfs.h>
@@ -438,5 +437,4 @@ static int __init brcm_gisb_driver_init(void)
 	return platform_driver_probe(&brcmstb_gisb_arb_driver,
 				     brcmstb_gisb_arb_probe);
 }
-
-module_init(brcm_gisb_driver_init);
+device_initcall(brcm_gisb_driver_init);
-- 
2.8.4

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

* [PATCH 2/4] bus: imx-weim: make it explicitly non-modular
  2016-07-03 17:30 [PATCH v2 0/4] bus: remove unused modular code from non-modular drivers Paul Gortmaker
  2016-07-03 17:30 ` [PATCH 1/4] bus: brcmstb_gisb: make it explicitly non-modular Paul Gortmaker
@ 2016-07-03 17:30 ` Paul Gortmaker
  2016-07-03 17:30 ` [PATCH 3/4] bus: tegra-aconnect: " Paul Gortmaker
  2016-07-03 17:30 ` [PATCH 4/4] bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate Paul Gortmaker
  3 siblings, 0 replies; 10+ messages in thread
From: Paul Gortmaker @ 2016-07-03 17:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Shawn Guo, Alison Chaiken, Sascha Hauer,
	Wolfram Sang, linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/bus/Kconfig:config IMX_WEIM
drivers/bus/Kconfig:    bool "Freescale EIM DRIVER

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Alison Chaiken <alison_chaiken@mentor.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/bus/imx-weim.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
index 4bd361d64270..cdc75b1b264d 100644
--- a/drivers/bus/imx-weim.c
+++ b/drivers/bus/imx-weim.c
@@ -7,7 +7,7 @@
  * License version 2. This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
  */
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/of_device.h>
@@ -57,7 +57,6 @@ static const struct of_device_id weim_id_table[] = {
 	{ .compatible = "fsl,imx51-weim", .data = &imx51_weim_devtype, },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, weim_id_table);
 
 static int __init imx_weim_gpr_setup(struct platform_device *pdev)
 {
@@ -209,8 +208,4 @@ static struct platform_driver weim_driver = {
 		.of_match_table	= weim_id_table,
 	},
 };
-module_platform_driver_probe(weim_driver, weim_probe);
-
-MODULE_AUTHOR("Freescale Semiconductor Inc.");
-MODULE_DESCRIPTION("i.MX EIM Controller Driver");
-MODULE_LICENSE("GPL");
+builtin_platform_driver_probe(weim_driver, weim_probe);
-- 
2.8.4

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

* [PATCH 3/4] bus: tegra-aconnect: make it explicitly non-modular
  2016-07-03 17:30 [PATCH v2 0/4] bus: remove unused modular code from non-modular drivers Paul Gortmaker
  2016-07-03 17:30 ` [PATCH 1/4] bus: brcmstb_gisb: make it explicitly non-modular Paul Gortmaker
  2016-07-03 17:30 ` [PATCH 2/4] bus: imx-weim: " Paul Gortmaker
@ 2016-07-03 17:30 ` Paul Gortmaker
  2016-07-04  9:17   ` Jon Hunter
  2016-07-03 17:30 ` [PATCH 4/4] bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate Paul Gortmaker
  3 siblings, 1 reply; 10+ messages in thread
From: Paul Gortmaker @ 2016-07-03 17:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Stephen Warren, Thierry Reding,
	Alexandre Courbot, Jon Hunter, linux-tegra, linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/bus/Kconfig:config TEGRA_ACONNECT
drivers/bus/Kconfig:    bool "Tegra ACONNECT Bus Driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
was (or is now) contained at the top of the file in the comments.

Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: linux-tegra@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/bus/tegra-aconnect.c | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/bus/tegra-aconnect.c b/drivers/bus/tegra-aconnect.c
index 7e4104b74fa8..f3982946ab8a 100644
--- a/drivers/bus/tegra-aconnect.c
+++ b/drivers/bus/tegra-aconnect.c
@@ -1,6 +1,8 @@
 /*
  * Tegra ACONNECT Bus Driver
  *
+ * Author: Jon Hunter <jonathanh@nvidia.com>
+ *
  * Copyright (C) 2016, NVIDIA CORPORATION.  All rights reserved.
  *
  * This file is subject to the terms and conditions of the GNU General Public
@@ -9,7 +11,7 @@
  */
 
 #include <linux/clk.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
 #include <linux/pm_clock.h>
@@ -66,15 +68,6 @@ clk_destroy:
 	return ret;
 }
 
-static int tegra_aconnect_remove(struct platform_device *pdev)
-{
-	pm_runtime_disable(&pdev->dev);
-
-	pm_clk_destroy(&pdev->dev);
-
-	return 0;
-}
-
 static int tegra_aconnect_runtime_resume(struct device *dev)
 {
 	return pm_clk_resume(dev);
@@ -94,19 +87,14 @@ static const struct of_device_id tegra_aconnect_of_match[] = {
 	{ .compatible = "nvidia,tegra210-aconnect", },
 	{ }
 };
-MODULE_DEVICE_TABLE(of, tegra_aconnect_of_match);
 
 static struct platform_driver tegra_aconnect_driver = {
 	.probe = tegra_aconnect_probe,
-	.remove = tegra_aconnect_remove,
 	.driver = {
 		.name = "tegra-aconnect",
+		.suppress_bind_attrs = true,
 		.of_match_table = tegra_aconnect_of_match,
 		.pm = &tegra_aconnect_pm_ops,
 	},
 };
-module_platform_driver(tegra_aconnect_driver);
-
-MODULE_DESCRIPTION("NVIDIA Tegra ACONNECT Bus Driver");
-MODULE_AUTHOR("Jon Hunter <jonathanh@nvidia.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(tegra_aconnect_driver);
-- 
2.8.4

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

* [PATCH 4/4] bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate
  2016-07-03 17:30 [PATCH v2 0/4] bus: remove unused modular code from non-modular drivers Paul Gortmaker
                   ` (2 preceding siblings ...)
  2016-07-03 17:30 ` [PATCH 3/4] bus: tegra-aconnect: " Paul Gortmaker
@ 2016-07-03 17:30 ` Paul Gortmaker
  2016-07-04 14:18   ` Geert Uytterhoeven
  3 siblings, 1 reply; 10+ messages in thread
From: Paul Gortmaker @ 2016-07-03 17:30 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Geert Uytterhoeven, Kevin Hilman, Simon Horman,
	linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

config SIMPLE_PM_BUS
        bool "Simple Power-Managed Bus Driver"

...meaning that it currently is not being built as a module by anyone.

In removing the orphaned modular support in a previous patch set,
Geert indicated he'd rather see this code converted to tristate.

I normally don't do that because it extends functionality that I
can't easily run time test or even know if the use case makes sense,
but since in this case the author has nominated it as such, we do
the conversion here.

Note that doesn't change the lack of run time testing ; this change
is only tested for sucessful compile and modpost.

Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: Kevin Hilman <khilman@linaro.org>
Cc: Simon Horman <horms+renesas@verge.net.au>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/bus/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 3b205e212337..f4162c76a5f6 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -109,7 +109,7 @@ config OMAP_OCP2SCP
 	  OCP2SCP.
 
 config SIMPLE_PM_BUS
-	bool "Simple Power-Managed Bus Driver"
+	tristate "Simple Power-Managed Bus Driver"
 	depends on OF && PM
 	depends on ARCH_RENESAS || COMPILE_TEST
 	help
-- 
2.8.4

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

* Re: [PATCH 3/4] bus: tegra-aconnect: make it explicitly non-modular
  2016-07-03 17:30 ` [PATCH 3/4] bus: tegra-aconnect: " Paul Gortmaker
@ 2016-07-04  9:17   ` Jon Hunter
  2016-07-04 13:41     ` Paul Gortmaker
  0 siblings, 1 reply; 10+ messages in thread
From: Jon Hunter @ 2016-07-04  9:17 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel
  Cc: Stephen Warren, Thierry Reding, Alexandre Courbot, linux-tegra,
	linux-arm-kernel

Hi Paul,

On 03/07/16 18:30, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/bus/Kconfig:config TEGRA_ACONNECT
> drivers/bus/Kconfig:    bool "Tegra ACONNECT Bus Driver"
> 
> ...meaning that it currently is not being built as a module by anyone.
> 
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> We explicitly disallow a driver unbind, since that doesn't have a
> sensible use case anyway, and it allows us to drop the ".remove"
> code for non-modular drivers.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> 
> We also delete the MODULE_LICENSE tag etc. since all that information
> was (or is now) contained at the top of the file in the comments.

In version 3 of the aconnect series [0] I had made this a tristate
because we allowed it to be removed and you had submitted a patch to
export the PM_CLK APIs. However, when discussing with Thierry he said
that we were unable to merge with tristate because of the dependency on
your patch. So he suggested we merge with bool for now and then change
it back to tristate for v4.9.

I understand that we should not do this, but we do plan to make this
modular in the future.

Cheers
Jon

[0] http://marc.info/?l=linux-tegra&m=146616753627760&w=2

-- 
nvpublic

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

* Re: [PATCH 3/4] bus: tegra-aconnect: make it explicitly non-modular
  2016-07-04  9:17   ` Jon Hunter
@ 2016-07-04 13:41     ` Paul Gortmaker
  2016-07-04 13:47       ` Jon Hunter
  0 siblings, 1 reply; 10+ messages in thread
From: Paul Gortmaker @ 2016-07-04 13:41 UTC (permalink / raw)
  To: Jon Hunter
  Cc: linux-kernel, Stephen Warren, Thierry Reding, Alexandre Courbot,
	linux-tegra, linux-arm-kernel

[Re: [PATCH 3/4] bus: tegra-aconnect: make it explicitly non-modular] On 04/07/2016 (Mon 10:17) Jon Hunter wrote:

> Hi Paul,
> 
> On 03/07/16 18:30, Paul Gortmaker wrote:
> > The Kconfig currently controlling compilation of this code is:
> > 
> > drivers/bus/Kconfig:config TEGRA_ACONNECT
> > drivers/bus/Kconfig:    bool "Tegra ACONNECT Bus Driver"
> > 
> > ...meaning that it currently is not being built as a module by anyone.
> > 
> > Lets remove the modular code that is essentially orphaned, so that
> > when reading the driver there is no doubt it is builtin-only.
> > 
> > We explicitly disallow a driver unbind, since that doesn't have a
> > sensible use case anyway, and it allows us to drop the ".remove"
> > code for non-modular drivers.
> > 
> > Since module_platform_driver() uses the same init level priority as
> > builtin_platform_driver() the init ordering remains unchanged with
> > this commit.
> > 
> > Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
> > 
> > We also delete the MODULE_LICENSE tag etc. since all that information
> > was (or is now) contained at the top of the file in the comments.
> 
> In version 3 of the aconnect series [0] I had made this a tristate
> because we allowed it to be removed and you had submitted a patch to
> export the PM_CLK APIs. However, when discussing with Thierry he said
> that we were unable to merge with tristate because of the dependency on
> your patch. So he suggested we merge with bool for now and then change
> it back to tristate for v4.9.

Oh I see.  The exported clock syms were for the 210 DMA driver and it
never crossed my mind that this driver needed the same syms in order for
it to be tristate.  Guess the exports proved useful afterall.  :)

> 
> I understand that we should not do this, but we do plan to make this
> modular in the future.

No problem ; I will drop this patch in favor of a one line Kconfig patch
in my test queue so it doesn't trip the regular audit, just like I have
for the 210 below -- not yet submitted for the same dependency reason.

P.
---


 From fe5bdc6348828c157deb14e8d75c732abcc2ad2b Mon Sep 17 00:00:00 2001
From: Paul Gortmaker <paul.gortmaker@windriver.com>
Date: Fri, 20 May 2016 14:30:43 -0400
Subject: [PATCH] dma: tegra210-adma: convert TEGRA210_ADMA from bool to
 tristate

This driver currently uses modular infrastructure but is controlled
by a bool Kconfig.

There is a general consensus from the DMA reviewers and maintainers
that "if it can be modular, it should be modular" in order to keep
the bzImage size under control for multi platform kernels.

Build tested only.  Also needs some new pm_clk symbols exported
before this commit is applied to tree in order to avoid modpost
errors like:

  ERROR: "pm_clk_add_clk" [drivers/dma/tegra210-adma.ko] undefined!
  ERROR: "pm_clk_create" [drivers/dma/tegra210-adma.ko] undefined!
  ERROR: "pm_clk_destroy" [drivers/dma/tegra210-adma.ko] undefined!
  ERROR: "pm_clk_suspend" [drivers/dma/tegra210-adma.ko] undefined!
  ERROR: "pm_clk_resume" [drivers/dma/tegra210-adma.ko] undefined!

Cc: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: dmaengine@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/dma/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
index 8c98779a12b1..866068d84ca2 100644
--- a/drivers/dma/Kconfig
+++ b/drivers/dma/Kconfig
@@ -468,7 +468,7 @@ config TEGRA20_APB_DMA
 	  or vice versa. It does not support memory to memory data transfer.
 
 config TEGRA210_ADMA
-	bool "NVIDIA Tegra210 ADMA support"
+	tristate "NVIDIA Tegra210 ADMA support"
 	depends on ARCH_TEGRA_210_SOC
 	select DMA_ENGINE
 	select DMA_VIRTUAL_CHANNELS
-- 
2.8.0

> 
> Cheers
> Jon
> 
> [0] http://marc.info/?l=linux-tegra&m=146616753627760&w=2
> 
> -- 
> nvpublic

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

* Re: [PATCH 3/4] bus: tegra-aconnect: make it explicitly non-modular
  2016-07-04 13:41     ` Paul Gortmaker
@ 2016-07-04 13:47       ` Jon Hunter
  0 siblings, 0 replies; 10+ messages in thread
From: Jon Hunter @ 2016-07-04 13:47 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Stephen Warren, Thierry Reding, Alexandre Courbot,
	linux-tegra, linux-arm-kernel


On 04/07/16 14:41, Paul Gortmaker wrote:
> [Re: [PATCH 3/4] bus: tegra-aconnect: make it explicitly non-modular] On 04/07/2016 (Mon 10:17) Jon Hunter wrote:
> 
>> Hi Paul,
>>
>> On 03/07/16 18:30, Paul Gortmaker wrote:
>>> The Kconfig currently controlling compilation of this code is:
>>>
>>> drivers/bus/Kconfig:config TEGRA_ACONNECT
>>> drivers/bus/Kconfig:    bool "Tegra ACONNECT Bus Driver"
>>>
>>> ...meaning that it currently is not being built as a module by anyone.
>>>
>>> Lets remove the modular code that is essentially orphaned, so that
>>> when reading the driver there is no doubt it is builtin-only.
>>>
>>> We explicitly disallow a driver unbind, since that doesn't have a
>>> sensible use case anyway, and it allows us to drop the ".remove"
>>> code for non-modular drivers.
>>>
>>> Since module_platform_driver() uses the same init level priority as
>>> builtin_platform_driver() the init ordering remains unchanged with
>>> this commit.
>>>
>>> Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
>>>
>>> We also delete the MODULE_LICENSE tag etc. since all that information
>>> was (or is now) contained at the top of the file in the comments.
>>
>> In version 3 of the aconnect series [0] I had made this a tristate
>> because we allowed it to be removed and you had submitted a patch to
>> export the PM_CLK APIs. However, when discussing with Thierry he said
>> that we were unable to merge with tristate because of the dependency on
>> your patch. So he suggested we merge with bool for now and then change
>> it back to tristate for v4.9.
> 
> Oh I see.  The exported clock syms were for the 210 DMA driver and it
> never crossed my mind that this driver needed the same syms in order for
> it to be tristate.  Guess the exports proved useful afterall.  :)

Yes indeed and I did learn my lesson after your previous catch for the
ADMA ;-)

>>
>> I understand that we should not do this, but we do plan to make this
>> modular in the future.
> 
> No problem ; I will drop this patch in favor of a one line Kconfig patch
> in my test queue so it doesn't trip the regular audit, just like I have
> for the 210 below -- not yet submitted for the same dependency reason.
> 
> P.
> ---
> 
> 
>  From fe5bdc6348828c157deb14e8d75c732abcc2ad2b Mon Sep 17 00:00:00 2001
> From: Paul Gortmaker <paul.gortmaker@windriver.com>
> Date: Fri, 20 May 2016 14:30:43 -0400
> Subject: [PATCH] dma: tegra210-adma: convert TEGRA210_ADMA from bool to
>  tristate
> 
> This driver currently uses modular infrastructure but is controlled
> by a bool Kconfig.
> 
> There is a general consensus from the DMA reviewers and maintainers
> that "if it can be modular, it should be modular" in order to keep
> the bzImage size under control for multi platform kernels.
> 
> Build tested only.  Also needs some new pm_clk symbols exported
> before this commit is applied to tree in order to avoid modpost
> errors like:
> 
>   ERROR: "pm_clk_add_clk" [drivers/dma/tegra210-adma.ko] undefined!
>   ERROR: "pm_clk_create" [drivers/dma/tegra210-adma.ko] undefined!
>   ERROR: "pm_clk_destroy" [drivers/dma/tegra210-adma.ko] undefined!
>   ERROR: "pm_clk_suspend" [drivers/dma/tegra210-adma.ko] undefined!
>   ERROR: "pm_clk_resume" [drivers/dma/tegra210-adma.ko] undefined!
> 
> Cc: Laxman Dewangan <ldewangan@nvidia.com>
> Cc: Jon Hunter <jonathanh@nvidia.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: dmaengine@vger.kernel.org
> Cc: linux-tegra@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/dma/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig
> index 8c98779a12b1..866068d84ca2 100644
> --- a/drivers/dma/Kconfig
> +++ b/drivers/dma/Kconfig
> @@ -468,7 +468,7 @@ config TEGRA20_APB_DMA
>  	  or vice versa. It does not support memory to memory data transfer.
>  
>  config TEGRA210_ADMA
> -	bool "NVIDIA Tegra210 ADMA support"
> +	tristate "NVIDIA Tegra210 ADMA support"
>  	depends on ARCH_TEGRA_210_SOC
>  	select DMA_ENGINE
>  	select DMA_VIRTUAL_CHANNELS

Thanks! FWIW ...

Acked-by: Jon Hunter <jonathanh@nvidia.com>

Cheers
Jon

-- 
nvpublic

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

* Re: [PATCH 4/4] bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate
  2016-07-03 17:30 ` [PATCH 4/4] bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate Paul Gortmaker
@ 2016-07-04 14:18   ` Geert Uytterhoeven
  0 siblings, 0 replies; 10+ messages in thread
From: Geert Uytterhoeven @ 2016-07-04 14:18 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Geert Uytterhoeven, Kevin Hilman, Simon Horman,
	linux-arm-kernel

Hi Paul,

On Sun, Jul 3, 2016 at 7:30 PM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> The Kconfig currently controlling compilation of this code is:
>
> config SIMPLE_PM_BUS
>         bool "Simple Power-Managed Bus Driver"
>
> ...meaning that it currently is not being built as a module by anyone.
>
> In removing the orphaned modular support in a previous patch set,
> Geert indicated he'd rather see this code converted to tristate.
>
> I normally don't do that because it extends functionality that I
> can't easily run time test or even know if the use case makes sense,
> but since in this case the author has nominated it as such, we do
> the conversion here.
>
> Note that doesn't change the lack of run time testing ; this change
> is only tested for sucessful compile and modpost.

Thanks!

> Cc: Geert Uytterhoeven <geert+renesas@glider.be>
> Cc: Kevin Hilman <khilman@linaro.org>
> Cc: Simon Horman <horms+renesas@verge.net.au>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Ethernet is probed successfully on sh73a0/kzm9g after insmodding
simple-pm-bus.ko.

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH 1/4] bus: brcmstb_gisb: make it explicitly non-modular
  2016-07-03 17:30 ` [PATCH 1/4] bus: brcmstb_gisb: make it explicitly non-modular Paul Gortmaker
@ 2016-07-14 22:34   ` Florian Fainelli
  0 siblings, 0 replies; 10+ messages in thread
From: Florian Fainelli @ 2016-07-14 22:34 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel; +Cc: Brian Norris, Gregory Fong, linux-arm-kernel

On 07/03/2016 10:30 AM, Paul Gortmaker wrote:
> The Kconfig for this driver is currently:
> 
> config BRCMSTB_GISB_ARB
>         bool "Broadcom STB GISB bus arbiter"
> 
> ...meaning that it currently is not being built as a module by anyone.
> Lets remove all modular references, so that when reading the driver
> there is no doubt it is builtin-only.
> 
> Since module_init translates to device_initcall in the non-modular
> case, the init ordering remains unchanged with this commit.
> 
> Cc: Brian Norris <computersforpeace@gmail.com>
> Acked-by: Brian Norris <computersforpeace@gmail.com>
> Cc: Gregory Fong <gregory.0xf0@gmail.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Acked-by: Florian Fainelli <f.fainelli@gmail.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Applied to drivers/next, thanks Paul
--
Florian

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

end of thread, other threads:[~2016-07-14 22:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-03 17:30 [PATCH v2 0/4] bus: remove unused modular code from non-modular drivers Paul Gortmaker
2016-07-03 17:30 ` [PATCH 1/4] bus: brcmstb_gisb: make it explicitly non-modular Paul Gortmaker
2016-07-14 22:34   ` Florian Fainelli
2016-07-03 17:30 ` [PATCH 2/4] bus: imx-weim: " Paul Gortmaker
2016-07-03 17:30 ` [PATCH 3/4] bus: tegra-aconnect: " Paul Gortmaker
2016-07-04  9:17   ` Jon Hunter
2016-07-04 13:41     ` Paul Gortmaker
2016-07-04 13:47       ` Jon Hunter
2016-07-03 17:30 ` [PATCH 4/4] bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate Paul Gortmaker
2016-07-04 14:18   ` Geert Uytterhoeven

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