All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-13  1:41 ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-arm-kernel

This series of commits is a slice of a larger project to ensure
people don't have dead code for module removal in non-modular
drivers.  Overall there was roughly 5k lines of dead code in the
kernel due to this.  So far we've fixed several areas, like tty,
x86, net, etc. and we continue to work on other areas.

There are several reasons to not use module_init for code that can
never be built as a module, but the big ones are:

 (1) it is easy to accidentally code up 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.

Here we convert some module_init() calls into device_initcall() and delete
any module_exit and remove code that gets orphaned in the process, for
an overall net code reduction, which is always welcome.

The use of device_initcall ensures that the init function ordering
remains unchanged, but one could argue that PCI host code might be more
appropriate to be handled under subsys_initcall.  Fortunately we can
revisit making this extra change at a later date if desired; it does
not need to happen now, and we reduce the risk of introducing
regressions at this point in time by separating the two changes.

Over half of the drivers changed here already explicitly disallowed any
unbind operations.  For the rest we make them the same, since there is
not really any sensible use case to unbind any built-in bus support that
I can think of.

I have more "avoid module usage in non-modular code" cleanups for the
PCI subsystem, but these all have a common theme and it makes for a
more maintainer friendly series size to just ask to digest these 1st.

Testing was done on linux-next, using an ARCH=arm allmodconfig and then
explicitly building the files changed in this series.  If desired, I
can provide a v4.4-rc4 based branch for merging vs e-mail processing,
since I don't think the underlying baseline is overly important for
this (largely trivial) series of patches.

Paul.
---

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Richard Zhu <Richard.Zhu@freescale.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: rfi@lists.rocketboards.org

Paul Gortmaker (10):
  drivers/pci: make host/pci-imx6.c driver explicitly non-modular
  drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular
  drivers/pci: make host/pci-mvebu.c explicitly non-modular
  drivers/pci: make host/pci-dra7xx.c explicitly non-modular
  drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
  drivers/pci: make host/pci-tegra.c explicitly non-modular
  drivers/pci: make host/pcie-rcar.c explicitly non-modular
  drivers/pci: make host/pcie-xilinx.c explicitly non-modular
  drivers/pci: make host/pci-keystone.c explicitly non-modular
  drivers/pci: make host/pcie-altera.c explicitly non-modular

 drivers/pci/host/pci-dra7xx.c     | 31 +++--------------------
 drivers/pci/host/pci-imx6.c       | 12 +++------
 drivers/pci/host/pci-keystone.c   | 21 +++-------------
 drivers/pci/host/pci-mvebu.c      | 11 +++-----
 drivers/pci/host/pci-rcar-gen2.c  | 12 +++------
 drivers/pci/host/pci-tegra.c      | 11 +++-----
 drivers/pci/host/pcie-altera.c    | 12 ++++-----
 drivers/pci/host/pcie-rcar.c      | 11 +++-----
 drivers/pci/host/pcie-spear13xx.c | 10 +++-----
 drivers/pci/host/pcie-xilinx.c    | 53 ++-------------------------------------
 10 files changed, 35 insertions(+), 149 deletions(-)

-- 
2.6.1


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

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-13  1:41 ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-sh, linux-pci, Paul Gortmaker, Thierry Reding,
	Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman, linux-tegra,
	linux-omap, linux-arm-kernel, Thomas Petazzoni, Richard Zhu, rfi,
	Ley Foon Tan, Bjorn Helgaas, Lucas Stach

This series of commits is a slice of a larger project to ensure
people don't have dead code for module removal in non-modular
drivers.  Overall there was roughly 5k lines of dead code in the
kernel due to this.  So far we've fixed several areas, like tty,
x86, net, etc. and we continue to work on other areas.

There are several reasons to not use module_init for code that can
never be built as a module, but the big ones are:

 (1) it is easy to accidentally code up 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.

Here we convert some module_init() calls into device_initcall() and delete
any module_exit and remove code that gets orphaned in the process, for
an overall net code reduction, which is always welcome.

The use of device_initcall ensures that the init function ordering
remains unchanged, but one could argue that PCI host code might be more
appropriate to be handled under subsys_initcall.  Fortunately we can
revisit making this extra change at a later date if desired; it does
not need to happen now, and we reduce the risk of introducing
regressions at this point in time by separating the two changes.

Over half of the drivers changed here already explicitly disallowed any
unbind operations.  For the rest we make them the same, since there is
not really any sensible use case to unbind any built-in bus support that
I can think of.

I have more "avoid module usage in non-modular code" cleanups for the
PCI subsystem, but these all have a common theme and it makes for a
more maintainer friendly series size to just ask to digest these 1st.

Testing was done on linux-next, using an ARCH=arm allmodconfig and then
explicitly building the files changed in this series.  If desired, I
can provide a v4.4-rc4 based branch for merging vs e-mail processing,
since I don't think the underlying baseline is overly important for
this (largely trivial) series of patches.

Paul.
---

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Richard Zhu <Richard.Zhu@freescale.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: rfi@lists.rocketboards.org

Paul Gortmaker (10):
  drivers/pci: make host/pci-imx6.c driver explicitly non-modular
  drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular
  drivers/pci: make host/pci-mvebu.c explicitly non-modular
  drivers/pci: make host/pci-dra7xx.c explicitly non-modular
  drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
  drivers/pci: make host/pci-tegra.c explicitly non-modular
  drivers/pci: make host/pcie-rcar.c explicitly non-modular
  drivers/pci: make host/pcie-xilinx.c explicitly non-modular
  drivers/pci: make host/pci-keystone.c explicitly non-modular
  drivers/pci: make host/pcie-altera.c explicitly non-modular

 drivers/pci/host/pci-dra7xx.c     | 31 +++--------------------
 drivers/pci/host/pci-imx6.c       | 12 +++------
 drivers/pci/host/pci-keystone.c   | 21 +++-------------
 drivers/pci/host/pci-mvebu.c      | 11 +++-----
 drivers/pci/host/pci-rcar-gen2.c  | 12 +++------
 drivers/pci/host/pci-tegra.c      | 11 +++-----
 drivers/pci/host/pcie-altera.c    | 12 ++++-----
 drivers/pci/host/pcie-rcar.c      | 11 +++-----
 drivers/pci/host/pcie-spear13xx.c | 10 +++-----
 drivers/pci/host/pcie-xilinx.c    | 53 ++-------------------------------------
 10 files changed, 35 insertions(+), 149 deletions(-)

-- 
2.6.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-13  1:41 ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Alexandre Courbot, Bjorn Helgaas, Jason Cooper,
	Kishon Vijay Abraham I, Ley Foon Tan, Lucas Stach, Michal Simek,
	Murali Karicheri, Pratyush Anand, Richard Zhu, Simon Horman,
	Sören Brinkmann, Stephen Warren, Thierry Reding,
	Thomas Petazzoni, linux-arm-kernel, linux-omap, linux-pci,
	linux-sh, linux-tegra, rfi

This series of commits is a slice of a larger project to ensure
people don't have dead code for module removal in non-modular
drivers.  Overall there was roughly 5k lines of dead code in the
kernel due to this.  So far we've fixed several areas, like tty,
x86, net, etc. and we continue to work on other areas.

There are several reasons to not use module_init for code that can
never be built as a module, but the big ones are:

 (1) it is easy to accidentally code up 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.

Here we convert some module_init() calls into device_initcall() and delete
any module_exit and remove code that gets orphaned in the process, for
an overall net code reduction, which is always welcome.

The use of device_initcall ensures that the init function ordering
remains unchanged, but one could argue that PCI host code might be more
appropriate to be handled under subsys_initcall.  Fortunately we can
revisit making this extra change at a later date if desired; it does
not need to happen now, and we reduce the risk of introducing
regressions at this point in time by separating the two changes.

Over half of the drivers changed here already explicitly disallowed any
unbind operations.  For the rest we make them the same, since there is
not really any sensible use case to unbind any built-in bus support that
I can think of.

I have more "avoid module usage in non-modular code" cleanups for the
PCI subsystem, but these all have a common theme and it makes for a
more maintainer friendly series size to just ask to digest these 1st.

Testing was done on linux-next, using an ARCH=arm allmodconfig and then
explicitly building the files changed in this series.  If desired, I
can provide a v4.4-rc4 based branch for merging vs e-mail processing,
since I don't think the underlying baseline is overly important for
this (largely trivial) series of patches.

Paul.
---

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Richard Zhu <Richard.Zhu@freescale.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-omap@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Cc: rfi@lists.rocketboards.org

Paul Gortmaker (10):
  drivers/pci: make host/pci-imx6.c driver explicitly non-modular
  drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular
  drivers/pci: make host/pci-mvebu.c explicitly non-modular
  drivers/pci: make host/pci-dra7xx.c explicitly non-modular
  drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
  drivers/pci: make host/pci-tegra.c explicitly non-modular
  drivers/pci: make host/pcie-rcar.c explicitly non-modular
  drivers/pci: make host/pcie-xilinx.c explicitly non-modular
  drivers/pci: make host/pci-keystone.c explicitly non-modular
  drivers/pci: make host/pcie-altera.c explicitly non-modular

 drivers/pci/host/pci-dra7xx.c     | 31 +++--------------------
 drivers/pci/host/pci-imx6.c       | 12 +++------
 drivers/pci/host/pci-keystone.c   | 21 +++-------------
 drivers/pci/host/pci-mvebu.c      | 11 +++-----
 drivers/pci/host/pci-rcar-gen2.c  | 12 +++------
 drivers/pci/host/pci-tegra.c      | 11 +++-----
 drivers/pci/host/pcie-altera.c    | 12 ++++-----
 drivers/pci/host/pcie-rcar.c      | 11 +++-----
 drivers/pci/host/pcie-spear13xx.c | 10 +++-----
 drivers/pci/host/pcie-xilinx.c    | 53 ++-------------------------------------
 10 files changed, 35 insertions(+), 149 deletions(-)

-- 
2.6.1


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

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-13  1:41 ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-arm-kernel

This series of commits is a slice of a larger project to ensure
people don't have dead code for module removal in non-modular
drivers.  Overall there was roughly 5k lines of dead code in the
kernel due to this.  So far we've fixed several areas, like tty,
x86, net, etc. and we continue to work on other areas.

There are several reasons to not use module_init for code that can
never be built as a module, but the big ones are:

 (1) it is easy to accidentally code up 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.

Here we convert some module_init() calls into device_initcall() and delete
any module_exit and remove code that gets orphaned in the process, for
an overall net code reduction, which is always welcome.

The use of device_initcall ensures that the init function ordering
remains unchanged, but one could argue that PCI host code might be more
appropriate to be handled under subsys_initcall.  Fortunately we can
revisit making this extra change at a later date if desired; it does
not need to happen now, and we reduce the risk of introducing
regressions at this point in time by separating the two changes.

Over half of the drivers changed here already explicitly disallowed any
unbind operations.  For the rest we make them the same, since there is
not really any sensible use case to unbind any built-in bus support that
I can think of.

I have more "avoid module usage in non-modular code" cleanups for the
PCI subsystem, but these all have a common theme and it makes for a
more maintainer friendly series size to just ask to digest these 1st.

Testing was done on linux-next, using an ARCH=arm allmodconfig and then
explicitly building the files changed in this series.  If desired, I
can provide a v4.4-rc4 based branch for merging vs e-mail processing,
since I don't think the underlying baseline is overly important for
this (largely trivial) series of patches.

Paul.
---

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Richard Zhu <Richard.Zhu@freescale.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: "S?ren Brinkmann" <soren.brinkmann@xilinx.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Cc: linux-arm-kernel at lists.infradead.org
Cc: linux-omap at vger.kernel.org
Cc: linux-pci at vger.kernel.org
Cc: linux-sh at vger.kernel.org
Cc: linux-tegra at vger.kernel.org
Cc: rfi at lists.rocketboards.org

Paul Gortmaker (10):
  drivers/pci: make host/pci-imx6.c driver explicitly non-modular
  drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular
  drivers/pci: make host/pci-mvebu.c explicitly non-modular
  drivers/pci: make host/pci-dra7xx.c explicitly non-modular
  drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
  drivers/pci: make host/pci-tegra.c explicitly non-modular
  drivers/pci: make host/pcie-rcar.c explicitly non-modular
  drivers/pci: make host/pcie-xilinx.c explicitly non-modular
  drivers/pci: make host/pci-keystone.c explicitly non-modular
  drivers/pci: make host/pcie-altera.c explicitly non-modular

 drivers/pci/host/pci-dra7xx.c     | 31 +++--------------------
 drivers/pci/host/pci-imx6.c       | 12 +++------
 drivers/pci/host/pci-keystone.c   | 21 +++-------------
 drivers/pci/host/pci-mvebu.c      | 11 +++-----
 drivers/pci/host/pci-rcar-gen2.c  | 12 +++------
 drivers/pci/host/pci-tegra.c      | 11 +++-----
 drivers/pci/host/pcie-altera.c    | 12 ++++-----
 drivers/pci/host/pcie-rcar.c      | 11 +++-----
 drivers/pci/host/pcie-spear13xx.c | 10 +++-----
 drivers/pci/host/pcie-xilinx.c    | 53 ++-------------------------------------
 10 files changed, 35 insertions(+), 149 deletions(-)

-- 
2.6.1

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

* [PATCH 01/10] drivers/pci: make host/pci-imx6.c driver explicitly non-modular
  2015-12-13  1:41 ` Paul Gortmaker
@ 2015-12-13  1:41   ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Richard Zhu, Lucas Stach, Bjorn Helgaas,
	linux-pci, linux-arm-kernel

The Kconfig for this option is currently:

config PCI_IMX6
        bool "Freescale i.MX6 PCIe controller"

...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity, 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.  An
alternate init level might be worth considering at a later date.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and there wasn't a supplied ".remove"
function to be called either.

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

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

Cc: Richard Zhu <Richard.Zhu@freescale.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-imx6.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index 22e8224126fd..ddd6a752b554 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -17,7 +17,7 @@
 #include <linux/kernel.h>
 #include <linux/mfd/syscon.h>
 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_gpio.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
@@ -641,24 +641,20 @@ static const struct of_device_id imx6_pcie_of_match[] = {
 	{ .compatible = "fsl,imx6q-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, imx6_pcie_of_match);
 
 static struct platform_driver imx6_pcie_driver = {
 	.driver = {
 		.name	= "imx6q-pcie",
 		.of_match_table = imx6_pcie_of_match,
+		.suppress_bind_attrs = true,
 	},
 	.shutdown = imx6_pcie_shutdown,
 };
 
-/* Freescale PCIe driver does not allow module unload */
+/* Freescale PCIe driver does not support module configuration */
 
 static int __init imx6_pcie_init(void)
 {
 	return platform_driver_probe(&imx6_pcie_driver, imx6_pcie_probe);
 }
-module_init(imx6_pcie_init);
-
-MODULE_AUTHOR("Sean Cross <xobs@kosagi.com>");
-MODULE_DESCRIPTION("Freescale i.MX6 PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+device_initcall(imx6_pcie_init);
-- 
2.6.1


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

* [PATCH 01/10] drivers/pci: make host/pci-imx6.c driver explicitly non-modular
@ 2015-12-13  1:41   ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-arm-kernel

The Kconfig for this option is currently:

config PCI_IMX6
        bool "Freescale i.MX6 PCIe controller"

...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity, 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.  An
alternate init level might be worth considering at a later date.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and there wasn't a supplied ".remove"
function to be called either.

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

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

Cc: Richard Zhu <Richard.Zhu@freescale.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-imx6.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index 22e8224126fd..ddd6a752b554 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -17,7 +17,7 @@
 #include <linux/kernel.h>
 #include <linux/mfd/syscon.h>
 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_gpio.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
@@ -641,24 +641,20 @@ static const struct of_device_id imx6_pcie_of_match[] = {
 	{ .compatible = "fsl,imx6q-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, imx6_pcie_of_match);
 
 static struct platform_driver imx6_pcie_driver = {
 	.driver = {
 		.name	= "imx6q-pcie",
 		.of_match_table = imx6_pcie_of_match,
+		.suppress_bind_attrs = true,
 	},
 	.shutdown = imx6_pcie_shutdown,
 };
 
-/* Freescale PCIe driver does not allow module unload */
+/* Freescale PCIe driver does not support module configuration */
 
 static int __init imx6_pcie_init(void)
 {
 	return platform_driver_probe(&imx6_pcie_driver, imx6_pcie_probe);
 }
-module_init(imx6_pcie_init);
-
-MODULE_AUTHOR("Sean Cross <xobs@kosagi.com>");
-MODULE_DESCRIPTION("Freescale i.MX6 PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+device_initcall(imx6_pcie_init);
-- 
2.6.1

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

* [PATCH 02/10] drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular
  2015-12-13  1:41 ` Paul Gortmaker
                   ` (3 preceding siblings ...)
  (?)
@ 2015-12-13  1:41 ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Pratyush Anand, Bjorn Helgaas, linux-pci

The Kconfig for this option is currently:

config PCIE_SPEAR13XX
        bool "STMicroelectronics SPEAr PCIe controller"

...meaning that it currently is not being built as a module by anyone.
Lets remove the couple traces of modularity, 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.  An
alternate init level might be worth considering at a later date.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and this driver had not populated ".remove"
with any function to be called either.

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: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-spear13xx.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pcie-spear13xx.c b/drivers/pci/host/pcie-spear13xx.c
index b95b7563c052..8248faa45f6f 100644
--- a/drivers/pci/host/pcie-spear13xx.c
+++ b/drivers/pci/host/pcie-spear13xx.c
@@ -16,7 +16,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of.h>
 #include <linux/pci.h>
 #include <linux/phy/phy.h>
@@ -366,13 +366,13 @@ static const struct of_device_id spear13xx_pcie_of_match[] = {
 	{ .compatible = "st,spear1340-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, spear13xx_pcie_of_match);
 
 static struct platform_driver spear13xx_pcie_driver = {
 	.probe		= spear13xx_pcie_probe,
 	.driver = {
 		.name	= "spear-pcie",
 		.of_match_table = of_match_ptr(spear13xx_pcie_of_match),
+		.suppress_bind_attrs = true,
 	},
 };
 
@@ -382,8 +382,4 @@ static int __init spear13xx_pcie_init(void)
 {
 	return platform_driver_register(&spear13xx_pcie_driver);
 }
-module_init(spear13xx_pcie_init);
-
-MODULE_DESCRIPTION("ST Microelectronics SPEAr13xx PCIe host controller driver");
-MODULE_AUTHOR("Pratyush Anand <pratyush.anand@gmail.com>");
-MODULE_LICENSE("GPL v2");
+device_initcall(spear13xx_pcie_init);
-- 
2.6.1


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

* [PATCH 03/10] drivers/pci: make host/pci-mvebu.c explicitly non-modular
  2015-12-13  1:41 ` Paul Gortmaker
@ 2015-12-13  1:41   ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Thomas Petazzoni, Jason Cooper, Bjorn Helgaas,
	linux-pci, linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_MVEBU
drivers/pci/host/Kconfig:       bool "Marvell EBU PCIe controller"

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

We don't have to disallow a driver unbind, since that is already
done for us in this driver.

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: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-mvebu.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 53b79c5f0559..17222f1a3ef3 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -1,6 +1,8 @@
 /*
  * PCIe driver for Marvell Armada 370 and Armada XP SoCs
  *
+ * Module Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
@@ -11,7 +13,7 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mbus.h>
 #include <linux/msi.h>
 #include <linux/slab.h>
@@ -1296,7 +1298,6 @@ static const struct of_device_id mvebu_pcie_of_match_table[] = {
 	{ .compatible = "marvell,kirkwood-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, mvebu_pcie_of_match_table);
 
 static struct dev_pm_ops mvebu_pcie_pm_ops = {
 	.suspend_noirq = mvebu_pcie_suspend,
@@ -1313,8 +1314,4 @@ static struct platform_driver mvebu_pcie_driver = {
 	},
 	.probe = mvebu_pcie_probe,
 };
-module_platform_driver(mvebu_pcie_driver);
-
-MODULE_AUTHOR("Thomas Petazzoni <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell EBU PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(mvebu_pcie_driver);
-- 
2.6.1


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

* [PATCH 03/10] drivers/pci: make host/pci-mvebu.c explicitly non-modular
@ 2015-12-13  1:41   ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_MVEBU
drivers/pci/host/Kconfig:       bool "Marvell EBU PCIe controller"

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

We don't have to disallow a driver unbind, since that is already
done for us in this driver.

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: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-mvebu.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c
index 53b79c5f0559..17222f1a3ef3 100644
--- a/drivers/pci/host/pci-mvebu.c
+++ b/drivers/pci/host/pci-mvebu.c
@@ -1,6 +1,8 @@
 /*
  * PCIe driver for Marvell Armada 370 and Armada XP SoCs
  *
+ * Module Author: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+ *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
@@ -11,7 +13,7 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/gpio.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/mbus.h>
 #include <linux/msi.h>
 #include <linux/slab.h>
@@ -1296,7 +1298,6 @@ static const struct of_device_id mvebu_pcie_of_match_table[] = {
 	{ .compatible = "marvell,kirkwood-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, mvebu_pcie_of_match_table);
 
 static struct dev_pm_ops mvebu_pcie_pm_ops = {
 	.suspend_noirq = mvebu_pcie_suspend,
@@ -1313,8 +1314,4 @@ static struct platform_driver mvebu_pcie_driver = {
 	},
 	.probe = mvebu_pcie_probe,
 };
-module_platform_driver(mvebu_pcie_driver);
-
-MODULE_AUTHOR("Thomas Petazzoni <thomas.petazzoni@free-electrons.com>");
-MODULE_DESCRIPTION("Marvell EBU PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(mvebu_pcie_driver);
-- 
2.6.1

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

* [PATCH 04/10] drivers/pci: make host/pci-dra7xx.c explicitly non-modular
  2015-12-13  1:41 ` Paul Gortmaker
@ 2015-12-13  1:41   ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Kishon Vijay Abraham I, Bjorn Helgaas,
	linux-omap, linux-pci

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_DRA7XX
drivers/pci/host/Kconfig:       bool "TI DRA7xx PCIe controller"

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

We don't replace module.h with init.h since the file already has that.

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: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-omap@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-dra7xx.c | 31 +++----------------------------
 1 file changed, 3 insertions(+), 28 deletions(-)

diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index 8c3688046c02..3769b7654c5d 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -16,7 +16,7 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_gpio.h>
 #include <linux/pci.h>
 #include <linux/phy/phy.h>
@@ -451,25 +451,6 @@ err_phy:
 	return ret;
 }
 
-static int __exit dra7xx_pcie_remove(struct platform_device *pdev)
-{
-	struct dra7xx_pcie *dra7xx = platform_get_drvdata(pdev);
-	struct pcie_port *pp = &dra7xx->pp;
-	struct device *dev = &pdev->dev;
-	int count = dra7xx->phy_count;
-
-	if (pp->irq_domain)
-		irq_domain_remove(pp->irq_domain);
-	pm_runtime_put(dev);
-	pm_runtime_disable(dev);
-	while (count--) {
-		phy_power_off(dra7xx->phy[count]);
-		phy_exit(dra7xx->phy[count]);
-	}
-
-	return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int dra7xx_pcie_suspend(struct device *dev)
 {
@@ -553,19 +534,13 @@ static const struct of_device_id of_dra7xx_pcie_match[] = {
 	{ .compatible = "ti,dra7-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, of_dra7xx_pcie_match);
 
 static struct platform_driver dra7xx_pcie_driver = {
-	.remove		= __exit_p(dra7xx_pcie_remove),
 	.driver = {
 		.name	= "dra7-pcie",
 		.of_match_table = of_dra7xx_pcie_match,
+		.suppress_bind_attrs = true,
 		.pm	= &dra7xx_pcie_pm_ops,
 	},
 };
-
-module_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe);
-
-MODULE_AUTHOR("Kishon Vijay Abraham I <kishon@ti.com>");
-MODULE_DESCRIPTION("TI PCIe controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe);
-- 
2.6.1


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

* [PATCH 04/10] drivers/pci: make host/pci-dra7xx.c explicitly non-modular
@ 2015-12-13  1:41   ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Kishon Vijay Abraham I, Bjorn Helgaas,
	linux-omap, linux-pci

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_DRA7XX
drivers/pci/host/Kconfig:       bool "TI DRA7xx PCIe controller"

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

We don't replace module.h with init.h since the file already has that.

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: Kishon Vijay Abraham I <kishon@ti.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-omap@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-dra7xx.c | 31 +++----------------------------
 1 file changed, 3 insertions(+), 28 deletions(-)

diff --git a/drivers/pci/host/pci-dra7xx.c b/drivers/pci/host/pci-dra7xx.c
index 8c3688046c02..3769b7654c5d 100644
--- a/drivers/pci/host/pci-dra7xx.c
+++ b/drivers/pci/host/pci-dra7xx.c
@@ -16,7 +16,7 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_gpio.h>
 #include <linux/pci.h>
 #include <linux/phy/phy.h>
@@ -451,25 +451,6 @@ err_phy:
 	return ret;
 }
 
-static int __exit dra7xx_pcie_remove(struct platform_device *pdev)
-{
-	struct dra7xx_pcie *dra7xx = platform_get_drvdata(pdev);
-	struct pcie_port *pp = &dra7xx->pp;
-	struct device *dev = &pdev->dev;
-	int count = dra7xx->phy_count;
-
-	if (pp->irq_domain)
-		irq_domain_remove(pp->irq_domain);
-	pm_runtime_put(dev);
-	pm_runtime_disable(dev);
-	while (count--) {
-		phy_power_off(dra7xx->phy[count]);
-		phy_exit(dra7xx->phy[count]);
-	}
-
-	return 0;
-}
-
 #ifdef CONFIG_PM_SLEEP
 static int dra7xx_pcie_suspend(struct device *dev)
 {
@@ -553,19 +534,13 @@ static const struct of_device_id of_dra7xx_pcie_match[] = {
 	{ .compatible = "ti,dra7-pcie", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, of_dra7xx_pcie_match);
 
 static struct platform_driver dra7xx_pcie_driver = {
-	.remove		= __exit_p(dra7xx_pcie_remove),
 	.driver = {
 		.name	= "dra7-pcie",
 		.of_match_table = of_dra7xx_pcie_match,
+		.suppress_bind_attrs = true,
 		.pm	= &dra7xx_pcie_pm_ops,
 	},
 };
-
-module_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe);
-
-MODULE_AUTHOR("Kishon Vijay Abraham I <kishon@ti.com>");
-MODULE_DESCRIPTION("TI PCIe controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver_probe(dra7xx_pcie_driver, dra7xx_pcie_probe);
-- 
2.6.1

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

* [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
  2015-12-13  1:41 ` Paul Gortmaker
@ 2015-12-13  1:41   ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Simon Horman, Bjorn Helgaas, linux-pci, linux-sh

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_RCAR_GEN2
drivers/pci/host/Kconfig:       bool "Renesas R-Car Gen2 Internal PCI controller"

...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 don't have to disallow a driver unbind, since that is already
done for us in this driver.

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

We don't replace module.h with init.h since the file already has that.

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: Simon Horman <horms@verge.net.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-rcar-gen2.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
index c4f64bfee551..81dda40c7a9f 100644
--- a/drivers/pci/host/pci-rcar-gen2.c
+++ b/drivers/pci/host/pci-rcar-gen2.c
@@ -4,6 +4,8 @@
  * Copyright (C) 2013 Renesas Solutions Corp.
  * Copyright (C) 2013 Cogent Embedded, Inc.
  *
+ * Module Author: Valentine Barshak <valentine.barshak@cogentembedded.com>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -14,7 +16,6 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/of_pci.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
@@ -366,8 +367,6 @@ static struct of_device_id rcar_pci_of_match[] = {
 	{ },
 };
 
-MODULE_DEVICE_TABLE(of, rcar_pci_of_match);
-
 static struct platform_driver rcar_pci_driver = {
 	.driver = {
 		.name = "pci-rcar-gen2",
@@ -376,9 +375,4 @@ static struct platform_driver rcar_pci_driver = {
 	},
 	.probe = rcar_pci_probe,
 };
-
-module_platform_driver(rcar_pci_driver);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("Renesas R-Car Gen2 internal PCI");
-MODULE_AUTHOR("Valentine Barshak <valentine.barshak@cogentembedded.com>");
+builtin_platform_driver(rcar_pci_driver);
-- 
2.6.1


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

* [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
@ 2015-12-13  1:41   ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Simon Horman, Bjorn Helgaas, linux-pci, linux-sh

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_RCAR_GEN2
drivers/pci/host/Kconfig:       bool "Renesas R-Car Gen2 Internal PCI controller"

...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 don't have to disallow a driver unbind, since that is already
done for us in this driver.

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

We don't replace module.h with init.h since the file already has that.

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: Simon Horman <horms@verge.net.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-rcar-gen2.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
index c4f64bfee551..81dda40c7a9f 100644
--- a/drivers/pci/host/pci-rcar-gen2.c
+++ b/drivers/pci/host/pci-rcar-gen2.c
@@ -4,6 +4,8 @@
  * Copyright (C) 2013 Renesas Solutions Corp.
  * Copyright (C) 2013 Cogent Embedded, Inc.
  *
+ * Module Author: Valentine Barshak <valentine.barshak@cogentembedded.com>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
@@ -14,7 +16,6 @@
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
 #include <linux/of_pci.h>
 #include <linux/pci.h>
 #include <linux/platform_device.h>
@@ -366,8 +367,6 @@ static struct of_device_id rcar_pci_of_match[] = {
 	{ },
 };
 
-MODULE_DEVICE_TABLE(of, rcar_pci_of_match);
-
 static struct platform_driver rcar_pci_driver = {
 	.driver = {
 		.name = "pci-rcar-gen2",
@@ -376,9 +375,4 @@ static struct platform_driver rcar_pci_driver = {
 	},
 	.probe = rcar_pci_probe,
 };
-
-module_platform_driver(rcar_pci_driver);
-
-MODULE_LICENSE("GPL v2");
-MODULE_DESCRIPTION("Renesas R-Car Gen2 internal PCI");
-MODULE_AUTHOR("Valentine Barshak <valentine.barshak@cogentembedded.com>");
+builtin_platform_driver(rcar_pci_driver);
-- 
2.6.1


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

* [PATCH 06/10] drivers/pci: make host/pci-tegra.c explicitly non-modular
  2015-12-13  1:41 ` Paul Gortmaker
@ 2015-12-13  1:41   ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Thierry Reding, Bjorn Helgaas, Stephen Warren,
	Alexandre Courbot, linux-tegra, linux-pci

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_TEGRA
drivers/pci/host/Kconfig:       bool "NVIDIA Tegra PCIe controller"

...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 don't have to disallow a driver unbind, since that is already
done for us in this driver.

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: Thierry Reding <thierry.reding@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: linux-tegra@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-tegra.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 3018ae52e092..b49ea58787c1 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -9,6 +9,8 @@
  *
  * Bits taken from arch/arm/mach-dove/pcie.c
  *
+ * Module Author: Thierry Reding <treding@nvidia.com>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -32,7 +34,7 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
@@ -1864,7 +1866,6 @@ static const struct of_device_id tegra_pcie_of_match[] = {
 	{ .compatible = "nvidia,tegra20-pcie", .data = &tegra20_pcie_data },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, tegra_pcie_of_match);
 
 static void *tegra_pcie_ports_seq_start(struct seq_file *s, loff_t *pos)
 {
@@ -2055,8 +2056,4 @@ static struct platform_driver tegra_pcie_driver = {
 	},
 	.probe = tegra_pcie_probe,
 };
-module_platform_driver(tegra_pcie_driver);
-
-MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
-MODULE_DESCRIPTION("NVIDIA Tegra PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(tegra_pcie_driver);
-- 
2.6.1

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

* [PATCH 06/10] drivers/pci: make host/pci-tegra.c explicitly non-modular
@ 2015-12-13  1:41   ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Thierry Reding, Bjorn Helgaas, Stephen Warren,
	Alexandre Courbot, linux-tegra, linux-pci

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_TEGRA
drivers/pci/host/Kconfig:       bool "NVIDIA Tegra PCIe controller"

...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 don't have to disallow a driver unbind, since that is already
done for us in this driver.

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: Thierry Reding <thierry.reding@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: linux-tegra@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-tegra.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pci-tegra.c b/drivers/pci/host/pci-tegra.c
index 3018ae52e092..b49ea58787c1 100644
--- a/drivers/pci/host/pci-tegra.c
+++ b/drivers/pci/host/pci-tegra.c
@@ -9,6 +9,8 @@
  *
  * Bits taken from arch/arm/mach-dove/pcie.c
  *
+ * Module Author: Thierry Reding <treding@nvidia.com>
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -32,7 +34,7 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
@@ -1864,7 +1866,6 @@ static const struct of_device_id tegra_pcie_of_match[] = {
 	{ .compatible = "nvidia,tegra20-pcie", .data = &tegra20_pcie_data },
 	{ },
 };
-MODULE_DEVICE_TABLE(of, tegra_pcie_of_match);
 
 static void *tegra_pcie_ports_seq_start(struct seq_file *s, loff_t *pos)
 {
@@ -2055,8 +2056,4 @@ static struct platform_driver tegra_pcie_driver = {
 	},
 	.probe = tegra_pcie_probe,
 };
-module_platform_driver(tegra_pcie_driver);
-
-MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>");
-MODULE_DESCRIPTION("NVIDIA Tegra PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(tegra_pcie_driver);
-- 
2.6.1


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

* [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
  2015-12-13  1:41 ` Paul Gortmaker
@ 2015-12-13  1:41   ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Simon Horman, Bjorn Helgaas, linux-pci, linux-sh

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"

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

We don't have to disallow a driver unbind, since that is already
done for us in this driver.

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: Simon Horman <horms@verge.net.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-rcar.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index f4fa6c537448..2c619277d265 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -7,6 +7,8 @@
  *  arch/sh/drivers/pci/ops-sh7786.c
  *  Copyright (C) 2009 - 2011  Paul Mundt
  *
+ * Module Author: Phil Edworthy <phil.edworthy@renesas.com>
+ *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
@@ -18,7 +20,7 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -921,7 +923,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
 	{ .compatible = "renesas,pcie-r8a7791", .data = rcar_pcie_hw_init },
 	{},
 };
-MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
 
 static int rcar_pcie_probe(struct platform_device *pdev)
 {
@@ -1007,8 +1008,4 @@ static struct platform_driver rcar_pcie_driver = {
 	},
 	.probe = rcar_pcie_probe,
 };
-module_platform_driver(rcar_pcie_driver);
-
-MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>");
-MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(rcar_pcie_driver);
-- 
2.6.1


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

* [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
@ 2015-12-13  1:41   ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Simon Horman, Bjorn Helgaas, linux-pci, linux-sh

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"

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

We don't have to disallow a driver unbind, since that is already
done for us in this driver.

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: Simon Horman <horms@verge.net.au>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-sh@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-rcar.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
index f4fa6c537448..2c619277d265 100644
--- a/drivers/pci/host/pcie-rcar.c
+++ b/drivers/pci/host/pcie-rcar.c
@@ -7,6 +7,8 @@
  *  arch/sh/drivers/pci/ops-sh7786.c
  *  Copyright (C) 2009 - 2011  Paul Mundt
  *
+ * Module Author: Phil Edworthy <phil.edworthy@renesas.com>
+ *
  * This file is licensed under the terms of the GNU General Public
  * License version 2.  This program is licensed "as is" without any
  * warranty of any kind, whether express or implied.
@@ -18,7 +20,7 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
@@ -921,7 +923,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
 	{ .compatible = "renesas,pcie-r8a7791", .data = rcar_pcie_hw_init },
 	{},
 };
-MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
 
 static int rcar_pcie_probe(struct platform_device *pdev)
 {
@@ -1007,8 +1008,4 @@ static struct platform_driver rcar_pcie_driver = {
 	},
 	.probe = rcar_pcie_probe,
 };
-module_platform_driver(rcar_pcie_driver);
-
-MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>");
-MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(rcar_pcie_driver);
-- 
2.6.1


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

* [PATCH 08/10] drivers/pci: make host/pcie-xilinx.c explicitly non-modular
  2015-12-13  1:41 ` Paul Gortmaker
@ 2015-12-13  1:41   ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Bjorn Helgaas, Michal Simek,
	Sören Brinkmann, linux-pci, linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_XILINX
drivers/pci/host/Kconfig:       bool "Xilinx AXI PCIe host bridge support"

...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.  This
makes xilinx_pcie_free_irq_domain orphaned so we remove it too.

We don't have to worry about disallowing a driver unbind, since this
driver already does that.

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

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: Bjorn Helgaas <bhelgaas@google.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-xilinx.c | 53 ++----------------------------------------
 1 file changed, 2 insertions(+), 51 deletions(-)

diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index 3c7a0d580b1e..73b5e856f9c2 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -18,7 +18,7 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
@@ -516,35 +516,6 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
 }
 
 /**
- * xilinx_pcie_free_irq_domain - Free IRQ domain
- * @port: PCIe port information
- */
-static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port *port)
-{
-	int i;
-	u32 irq, num_irqs;
-
-	/* Free IRQ Domain */
-	if (IS_ENABLED(CONFIG_PCI_MSI)) {
-
-		free_pages(port->msi_pages, 0);
-
-		num_irqs = XILINX_NUM_MSI_IRQS;
-	} else {
-		/* INTx */
-		num_irqs = 4;
-	}
-
-	for (i = 0; i < num_irqs; i++) {
-		irq = irq_find_mapping(port->irq_domain, i);
-		if (irq > 0)
-			irq_dispose_mapping(irq);
-	}
-
-	irq_domain_remove(port->irq_domain);
-}
-
-/**
  * xilinx_pcie_init_irq_domain - Initialize IRQ domain
  * @port: PCIe port information
  *
@@ -858,21 +829,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
 	return 0;
 }
 
-/**
- * xilinx_pcie_remove - Remove function
- * @pdev: Platform device pointer
- *
- * Return: '0' always
- */
-static int xilinx_pcie_remove(struct platform_device *pdev)
-{
-	struct xilinx_pcie_port *port = platform_get_drvdata(pdev);
-
-	xilinx_pcie_free_irq_domain(port);
-
-	return 0;
-}
-
 static struct of_device_id xilinx_pcie_of_match[] = {
 	{ .compatible = "xlnx,axi-pcie-host-1.00.a", },
 	{}
@@ -885,10 +841,5 @@ static struct platform_driver xilinx_pcie_driver = {
 		.suppress_bind_attrs = true,
 	},
 	.probe = xilinx_pcie_probe,
-	.remove = xilinx_pcie_remove,
 };
-module_platform_driver(xilinx_pcie_driver);
-
-MODULE_AUTHOR("Xilinx Inc");
-MODULE_DESCRIPTION("Xilinx AXI PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(xilinx_pcie_driver);
-- 
2.6.1


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

* [PATCH 08/10] drivers/pci: make host/pcie-xilinx.c explicitly non-modular
@ 2015-12-13  1:41   ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_XILINX
drivers/pci/host/Kconfig:       bool "Xilinx AXI PCIe host bridge support"

...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.  This
makes xilinx_pcie_free_irq_domain orphaned so we remove it too.

We don't have to worry about disallowing a driver unbind, since this
driver already does that.

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

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: Bjorn Helgaas <bhelgaas@google.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: "S?ren Brinkmann" <soren.brinkmann@xilinx.com>
Cc: linux-pci at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-xilinx.c | 53 ++----------------------------------------
 1 file changed, 2 insertions(+), 51 deletions(-)

diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index 3c7a0d580b1e..73b5e856f9c2 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -18,7 +18,7 @@
 #include <linux/irq.h>
 #include <linux/irqdomain.h>
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
@@ -516,35 +516,6 @@ static irqreturn_t xilinx_pcie_intr_handler(int irq, void *data)
 }
 
 /**
- * xilinx_pcie_free_irq_domain - Free IRQ domain
- * @port: PCIe port information
- */
-static void xilinx_pcie_free_irq_domain(struct xilinx_pcie_port *port)
-{
-	int i;
-	u32 irq, num_irqs;
-
-	/* Free IRQ Domain */
-	if (IS_ENABLED(CONFIG_PCI_MSI)) {
-
-		free_pages(port->msi_pages, 0);
-
-		num_irqs = XILINX_NUM_MSI_IRQS;
-	} else {
-		/* INTx */
-		num_irqs = 4;
-	}
-
-	for (i = 0; i < num_irqs; i++) {
-		irq = irq_find_mapping(port->irq_domain, i);
-		if (irq > 0)
-			irq_dispose_mapping(irq);
-	}
-
-	irq_domain_remove(port->irq_domain);
-}
-
-/**
  * xilinx_pcie_init_irq_domain - Initialize IRQ domain
  * @port: PCIe port information
  *
@@ -858,21 +829,6 @@ static int xilinx_pcie_probe(struct platform_device *pdev)
 	return 0;
 }
 
-/**
- * xilinx_pcie_remove - Remove function
- * @pdev: Platform device pointer
- *
- * Return: '0' always
- */
-static int xilinx_pcie_remove(struct platform_device *pdev)
-{
-	struct xilinx_pcie_port *port = platform_get_drvdata(pdev);
-
-	xilinx_pcie_free_irq_domain(port);
-
-	return 0;
-}
-
 static struct of_device_id xilinx_pcie_of_match[] = {
 	{ .compatible = "xlnx,axi-pcie-host-1.00.a", },
 	{}
@@ -885,10 +841,5 @@ static struct platform_driver xilinx_pcie_driver = {
 		.suppress_bind_attrs = true,
 	},
 	.probe = xilinx_pcie_probe,
-	.remove = xilinx_pcie_remove,
 };
-module_platform_driver(xilinx_pcie_driver);
-
-MODULE_AUTHOR("Xilinx Inc");
-MODULE_DESCRIPTION("Xilinx AXI PCIe driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(xilinx_pcie_driver);
-- 
2.6.1

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

* [PATCH 09/10] drivers/pci: make host/pci-keystone.c explicitly non-modular
  2015-12-13  1:41 ` Paul Gortmaker
@ 2015-12-13  1:41   ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, Murali Karicheri, Bjorn Helgaas, linux-pci,
	linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_KEYSTONE
drivers/pci/host/Kconfig:       bool "TI Keystone PCIe controller"

...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
is already contained at the top of the file in the comments.

Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-keystone.c | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c
index 0aa81bd3de12..0493d4257bde 100644
--- a/drivers/pci/host/pci-keystone.c
+++ b/drivers/pci/host/pci-keystone.c
@@ -16,7 +16,7 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/irqdomain.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_irq.h>
 #include <linux/of.h>
@@ -329,16 +329,6 @@ static const struct of_device_id ks_pcie_of_match[] = {
 	},
 	{ },
 };
-MODULE_DEVICE_TABLE(of, ks_pcie_of_match);
-
-static int __exit ks_pcie_remove(struct platform_device *pdev)
-{
-	struct keystone_pcie *ks_pcie = platform_get_drvdata(pdev);
-
-	clk_disable_unprepare(ks_pcie->clk);
-
-	return 0;
-}
 
 static int __init ks_pcie_probe(struct platform_device *pdev)
 {
@@ -398,15 +388,10 @@ fail_clk:
 
 static struct platform_driver ks_pcie_driver __refdata = {
 	.probe  = ks_pcie_probe,
-	.remove = __exit_p(ks_pcie_remove),
 	.driver = {
 		.name	= "keystone-pcie",
 		.of_match_table = of_match_ptr(ks_pcie_of_match),
+		.suppress_bind_attrs = true,
 	},
 };
-
-module_platform_driver(ks_pcie_driver);
-
-MODULE_AUTHOR("Murali Karicheri <m-karicheri2@ti.com>");
-MODULE_DESCRIPTION("Keystone PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(ks_pcie_driver);
-- 
2.6.1


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

* [PATCH 09/10] drivers/pci: make host/pci-keystone.c explicitly non-modular
@ 2015-12-13  1:41   ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-arm-kernel

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_KEYSTONE
drivers/pci/host/Kconfig:       bool "TI Keystone PCIe controller"

...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
is already contained at the top of the file in the comments.

Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pci-keystone.c | 21 +++------------------
 1 file changed, 3 insertions(+), 18 deletions(-)

diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c
index 0aa81bd3de12..0493d4257bde 100644
--- a/drivers/pci/host/pci-keystone.c
+++ b/drivers/pci/host/pci-keystone.c
@@ -16,7 +16,7 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/irqdomain.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/msi.h>
 #include <linux/of_irq.h>
 #include <linux/of.h>
@@ -329,16 +329,6 @@ static const struct of_device_id ks_pcie_of_match[] = {
 	},
 	{ },
 };
-MODULE_DEVICE_TABLE(of, ks_pcie_of_match);
-
-static int __exit ks_pcie_remove(struct platform_device *pdev)
-{
-	struct keystone_pcie *ks_pcie = platform_get_drvdata(pdev);
-
-	clk_disable_unprepare(ks_pcie->clk);
-
-	return 0;
-}
 
 static int __init ks_pcie_probe(struct platform_device *pdev)
 {
@@ -398,15 +388,10 @@ fail_clk:
 
 static struct platform_driver ks_pcie_driver __refdata = {
 	.probe  = ks_pcie_probe,
-	.remove = __exit_p(ks_pcie_remove),
 	.driver = {
 		.name	= "keystone-pcie",
 		.of_match_table = of_match_ptr(ks_pcie_of_match),
+		.suppress_bind_attrs = true,
 	},
 };
-
-module_platform_driver(ks_pcie_driver);
-
-MODULE_AUTHOR("Murali Karicheri <m-karicheri2@ti.com>");
-MODULE_DESCRIPTION("Keystone PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(ks_pcie_driver);
-- 
2.6.1

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

* [PATCH 10/10] drivers/pci: make host/pcie-altera.c explicitly non-modular
  2015-12-13  1:41 ` Paul Gortmaker
                   ` (11 preceding siblings ...)
  (?)
@ 2015-12-13  1:41 ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13  1:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Gortmaker, Ley Foon Tan, Bjorn Helgaas, rfi, linux-pci

The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCIE_ALTERA
drivers/pci/host/Kconfig:       bool "Altera PCIe controller"

...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 don't have to disallow a driver unbind, since that is already
done for us in this driver.

Since module_init translates to device_initcall in the non-modular
case, 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: Ley Foon Tan <lftan@altera.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: rfi@lists.rocketboards.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 drivers/pci/host/pcie-altera.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/pci/host/pcie-altera.c b/drivers/pci/host/pcie-altera.c
index 99da549d5d06..ba55885d508f 100644
--- a/drivers/pci/host/pcie-altera.c
+++ b/drivers/pci/host/pcie-altera.c
@@ -1,6 +1,9 @@
 /*
  * Copyright Altera Corporation (C) 2013-2015. All rights reserved
  *
+ * Author: Ley Foon Tan <lftan@altera.com>
+ * Description: Altera PCIe host controller driver
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
  * version 2, as published by the Free Software Foundation.
@@ -17,7 +20,7 @@
 #include <linux/delay.h>
 #include <linux/interrupt.h>
 #include <linux/irqchip/chained_irq.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/of_pci.h>
@@ -566,7 +569,6 @@ static const struct of_device_id altera_pcie_of_match[] = {
 	{ .compatible = "altr,pcie-root-port-1.0", },
 	{},
 };
-MODULE_DEVICE_TABLE(of, altera_pcie_of_match);
 
 static struct platform_driver altera_pcie_driver = {
 	.probe		= altera_pcie_probe,
@@ -581,8 +583,4 @@ static int altera_pcie_init(void)
 {
 	return platform_driver_register(&altera_pcie_driver);
 }
-module_init(altera_pcie_init);
-
-MODULE_AUTHOR("Ley Foon Tan <lftan@altera.com>");
-MODULE_DESCRIPTION("Altera PCIe host controller driver");
-MODULE_LICENSE("GPL v2");
+device_initcall(altera_pcie_init);
-- 
2.6.1


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

* Re: [PATCH 03/10] drivers/pci: make host/pci-mvebu.c explicitly non-modular
  2015-12-13  1:41   ` Paul Gortmaker
@ 2015-12-13 10:33     ` Thomas Petazzoni
  -1 siblings, 0 replies; 82+ messages in thread
From: Thomas Petazzoni @ 2015-12-13 10:33 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Jason Cooper, Bjorn Helgaas, linux-pci, linux-arm-kernel

Paul,

On Sat, 12 Dec 2015 20:41:50 -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_MVEBU
> drivers/pci/host/Kconfig:       bool "Marvell EBU PCIe controller"
> 
> ...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.
> 
> We don't have to disallow a driver unbind, since that is already
> done for us in this driver.
> 
> 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: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/pci/host/pci-mvebu.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)

I think the general direction should rather be to change the PCI
subsystem to make it possible for those drivers to be built as modules.
However, since this is quite certainly a much larger effort, there is
no reason to not clean things up as they are today, so:

Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [PATCH 03/10] drivers/pci: make host/pci-mvebu.c explicitly non-modular
@ 2015-12-13 10:33     ` Thomas Petazzoni
  0 siblings, 0 replies; 82+ messages in thread
From: Thomas Petazzoni @ 2015-12-13 10:33 UTC (permalink / raw)
  To: linux-arm-kernel

Paul,

On Sat, 12 Dec 2015 20:41:50 -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_MVEBU
> drivers/pci/host/Kconfig:       bool "Marvell EBU PCIe controller"
> 
> ...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.
> 
> We don't have to disallow a driver unbind, since that is already
> done for us in this driver.
> 
> 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: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/pci/host/pci-mvebu.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)

I think the general direction should rather be to change the PCI
subsystem to make it possible for those drivers to be built as modules.
However, since this is quite certainly a much larger effort, there is
no reason to not clean things up as they are today, so:

Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* Re: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
  2015-12-13  1:41   ` Paul Gortmaker
@ 2015-12-13 10:58     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 82+ messages in thread
From: Geert Uytterhoeven @ 2015-12-13 10:58 UTC (permalink / raw)
  To: Paul Gortmaker, Phil Edworthy
  Cc: linux-kernel, Simon Horman, Bjorn Helgaas, linux-pci, Linux-sh list

CC MODULE_AUTHOR

On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> The Kconfig currently controlling compilation of this code is:
>
> drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
> drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"
>
> ...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.
>
> We don't have to disallow a driver unbind, since that is already
> done for us in this driver.
>
> 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: Simon Horman <horms@verge.net.au>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/pci/host/pcie-rcar.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> index f4fa6c537448..2c619277d265 100644
> --- a/drivers/pci/host/pcie-rcar.c
> +++ b/drivers/pci/host/pcie-rcar.c
> @@ -7,6 +7,8 @@
>   *  arch/sh/drivers/pci/ops-sh7786.c
>   *  Copyright (C) 2009 - 2011  Paul Mundt
>   *
> + * Module Author: Phil Edworthy <phil.edworthy@renesas.com>
> + *
>   * This file is licensed under the terms of the GNU General Public
>   * License version 2.  This program is licensed "as is" without any
>   * warranty of any kind, whether express or implied.
> @@ -18,7 +20,7 @@
>  #include <linux/irq.h>
>  #include <linux/irqdomain.h>
>  #include <linux/kernel.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/msi.h>
>  #include <linux/of_address.h>
>  #include <linux/of_irq.h>
> @@ -921,7 +923,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
>         { .compatible = "renesas,pcie-r8a7791", .data = rcar_pcie_hw_init },
>         {},
>  };
> -MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
>
>  static int rcar_pcie_probe(struct platform_device *pdev)
>  {
> @@ -1007,8 +1008,4 @@ static struct platform_driver rcar_pcie_driver = {
>         },
>         .probe = rcar_pcie_probe,
>  };
> -module_platform_driver(rcar_pcie_driver);
> -
> -MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>");
> -MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(rcar_pcie_driver);

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] 82+ messages in thread

* Re: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
@ 2015-12-13 10:58     ` Geert Uytterhoeven
  0 siblings, 0 replies; 82+ messages in thread
From: Geert Uytterhoeven @ 2015-12-13 10:58 UTC (permalink / raw)
  To: Paul Gortmaker, Phil Edworthy
  Cc: linux-kernel, Simon Horman, Bjorn Helgaas, linux-pci, Linux-sh list

CC MODULE_AUTHOR

On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> The Kconfig currently controlling compilation of this code is:
>
> drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
> drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"
>
> ...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.
>
> We don't have to disallow a driver unbind, since that is already
> done for us in this driver.
>
> 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: Simon Horman <horms@verge.net.au>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/pci/host/pcie-rcar.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> index f4fa6c537448..2c619277d265 100644
> --- a/drivers/pci/host/pcie-rcar.c
> +++ b/drivers/pci/host/pcie-rcar.c
> @@ -7,6 +7,8 @@
>   *  arch/sh/drivers/pci/ops-sh7786.c
>   *  Copyright (C) 2009 - 2011  Paul Mundt
>   *
> + * Module Author: Phil Edworthy <phil.edworthy@renesas.com>
> + *
>   * This file is licensed under the terms of the GNU General Public
>   * License version 2.  This program is licensed "as is" without any
>   * warranty of any kind, whether express or implied.
> @@ -18,7 +20,7 @@
>  #include <linux/irq.h>
>  #include <linux/irqdomain.h>
>  #include <linux/kernel.h>
> -#include <linux/module.h>
> +#include <linux/init.h>
>  #include <linux/msi.h>
>  #include <linux/of_address.h>
>  #include <linux/of_irq.h>
> @@ -921,7 +923,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
>         { .compatible = "renesas,pcie-r8a7791", .data = rcar_pcie_hw_init },
>         {},
>  };
> -MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
>
>  static int rcar_pcie_probe(struct platform_device *pdev)
>  {
> @@ -1007,8 +1008,4 @@ static struct platform_driver rcar_pcie_driver = {
>         },
>         .probe = rcar_pcie_probe,
>  };
> -module_platform_driver(rcar_pcie_driver);
> -
> -MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>");
> -MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
> -MODULE_LICENSE("GPL v2");
> +builtin_platform_driver(rcar_pcie_driver);

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] 82+ messages in thread

* Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
  2015-12-13  1:41   ` Paul Gortmaker
@ 2015-12-13 10:59     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 82+ messages in thread
From: Geert Uytterhoeven @ 2015-12-13 10:59 UTC (permalink / raw)
  To: Paul Gortmaker, Valentine Barshak
  Cc: linux-kernel, Simon Horman, Bjorn Helgaas, linux-pci, Linux-sh list

CC MODULE_AUTHOR

On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> The Kconfig currently controlling compilation of this code is:
>
> drivers/pci/host/Kconfig:config PCI_RCAR_GEN2
> drivers/pci/host/Kconfig:       bool "Renesas R-Car Gen2 Internal PCI controller"
>
> ...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 don't have to disallow a driver unbind, since that is already
> done for us in this driver.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> We don't replace module.h with init.h since the file already has that.
>
> 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: Simon Horman <horms@verge.net.au>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/pci/host/pci-rcar-gen2.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
> index c4f64bfee551..81dda40c7a9f 100644
> --- a/drivers/pci/host/pci-rcar-gen2.c
> +++ b/drivers/pci/host/pci-rcar-gen2.c
> @@ -4,6 +4,8 @@
>   * Copyright (C) 2013 Renesas Solutions Corp.
>   * Copyright (C) 2013 Cogent Embedded, Inc.
>   *
> + * Module Author: Valentine Barshak <valentine.barshak@cogentembedded.com>
> + *
>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License version 2 as
>   * published by the Free Software Foundation.
> @@ -14,7 +16,6 @@
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
>  #include <linux/kernel.h>
> -#include <linux/module.h>
>  #include <linux/of_pci.h>
>  #include <linux/pci.h>
>  #include <linux/platform_device.h>
> @@ -366,8 +367,6 @@ static struct of_device_id rcar_pci_of_match[] = {
>         { },
>  };
>
> -MODULE_DEVICE_TABLE(of, rcar_pci_of_match);
> -
>  static struct platform_driver rcar_pci_driver = {
>         .driver = {
>                 .name = "pci-rcar-gen2",
> @@ -376,9 +375,4 @@ static struct platform_driver rcar_pci_driver = {
>         },
>         .probe = rcar_pci_probe,
>  };
> -
> -module_platform_driver(rcar_pci_driver);
> -
> -MODULE_LICENSE("GPL v2");
> -MODULE_DESCRIPTION("Renesas R-Car Gen2 internal PCI");
> -MODULE_AUTHOR("Valentine Barshak <valentine.barshak@cogentembedded.com>");
> +builtin_platform_driver(rcar_pci_driver);

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] 82+ messages in thread

* Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
@ 2015-12-13 10:59     ` Geert Uytterhoeven
  0 siblings, 0 replies; 82+ messages in thread
From: Geert Uytterhoeven @ 2015-12-13 10:59 UTC (permalink / raw)
  To: Paul Gortmaker, Valentine Barshak
  Cc: linux-kernel, Simon Horman, Bjorn Helgaas, linux-pci, Linux-sh list

CC MODULE_AUTHOR

On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> The Kconfig currently controlling compilation of this code is:
>
> drivers/pci/host/Kconfig:config PCI_RCAR_GEN2
> drivers/pci/host/Kconfig:       bool "Renesas R-Car Gen2 Internal PCI controller"
>
> ...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 don't have to disallow a driver unbind, since that is already
> done for us in this driver.
>
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
>
> We don't replace module.h with init.h since the file already has that.
>
> 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: Simon Horman <horms@verge.net.au>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/pci/host/pci-rcar-gen2.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
> index c4f64bfee551..81dda40c7a9f 100644
> --- a/drivers/pci/host/pci-rcar-gen2.c
> +++ b/drivers/pci/host/pci-rcar-gen2.c
> @@ -4,6 +4,8 @@
>   * Copyright (C) 2013 Renesas Solutions Corp.
>   * Copyright (C) 2013 Cogent Embedded, Inc.
>   *
> + * Module Author: Valentine Barshak <valentine.barshak@cogentembedded.com>
> + *
>   * This program is free software; you can redistribute it and/or modify
>   * it under the terms of the GNU General Public License version 2 as
>   * published by the Free Software Foundation.
> @@ -14,7 +16,6 @@
>  #include <linux/interrupt.h>
>  #include <linux/io.h>
>  #include <linux/kernel.h>
> -#include <linux/module.h>
>  #include <linux/of_pci.h>
>  #include <linux/pci.h>
>  #include <linux/platform_device.h>
> @@ -366,8 +367,6 @@ static struct of_device_id rcar_pci_of_match[] = {
>         { },
>  };
>
> -MODULE_DEVICE_TABLE(of, rcar_pci_of_match);
> -
>  static struct platform_driver rcar_pci_driver = {
>         .driver = {
>                 .name = "pci-rcar-gen2",
> @@ -376,9 +375,4 @@ static struct platform_driver rcar_pci_driver = {
>         },
>         .probe = rcar_pci_probe,
>  };
> -
> -module_platform_driver(rcar_pci_driver);
> -
> -MODULE_LICENSE("GPL v2");
> -MODULE_DESCRIPTION("Renesas R-Car Gen2 internal PCI");
> -MODULE_AUTHOR("Valentine Barshak <valentine.barshak@cogentembedded.com>");
> +builtin_platform_driver(rcar_pci_driver);

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] 82+ messages in thread

* Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
  2015-12-13 10:59     ` Geert Uytterhoeven
@ 2015-12-13 18:15       ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13 18:15 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Valentine Barshak, linux-kernel, Simon Horman, Bjorn Helgaas,
	linux-pci, Linux-sh list, Joe Perches

[Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular] On 13/12/2015 (Sun 11:59) Geert Uytterhoeven wrote:

> CC MODULE_AUTHOR

Thanks, I just assumed get-maintainer.pl would have automatically
collected that up with the other names it emits.  Apparently not.

Joe: is there a reason it doesn't use the module author field?

Paul.
--

> 
> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > The Kconfig currently controlling compilation of this code is:
> >
> > drivers/pci/host/Kconfig:config PCI_RCAR_GEN2
> > drivers/pci/host/Kconfig:       bool "Renesas R-Car Gen2 Internal PCI controller"
> >
> > ...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 don't have to disallow a driver unbind, since that is already
> > done for us in this driver.
> >
> > Since module_platform_driver() uses the same init level priority as
> > builtin_platform_driver() the init ordering remains unchanged with
> > this commit.
> >
> > We don't replace module.h with init.h since the file already has that.
> >
> > 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: Simon Horman <horms@verge.net.au>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: linux-pci@vger.kernel.org
> > Cc: linux-sh@vger.kernel.org
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > ---
> >  drivers/pci/host/pci-rcar-gen2.c | 12 +++---------
> >  1 file changed, 3 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
> > index c4f64bfee551..81dda40c7a9f 100644
> > --- a/drivers/pci/host/pci-rcar-gen2.c
> > +++ b/drivers/pci/host/pci-rcar-gen2.c
> > @@ -4,6 +4,8 @@
> >   * Copyright (C) 2013 Renesas Solutions Corp.
> >   * Copyright (C) 2013 Cogent Embedded, Inc.
> >   *
> > + * Module Author: Valentine Barshak <valentine.barshak@cogentembedded.com>
> > + *
> >   * This program is free software; you can redistribute it and/or modify
> >   * it under the terms of the GNU General Public License version 2 as
> >   * published by the Free Software Foundation.
> > @@ -14,7 +16,6 @@
> >  #include <linux/interrupt.h>
> >  #include <linux/io.h>
> >  #include <linux/kernel.h>
> > -#include <linux/module.h>
> >  #include <linux/of_pci.h>
> >  #include <linux/pci.h>
> >  #include <linux/platform_device.h>
> > @@ -366,8 +367,6 @@ static struct of_device_id rcar_pci_of_match[] = {
> >         { },
> >  };
> >
> > -MODULE_DEVICE_TABLE(of, rcar_pci_of_match);
> > -
> >  static struct platform_driver rcar_pci_driver = {
> >         .driver = {
> >                 .name = "pci-rcar-gen2",
> > @@ -376,9 +375,4 @@ static struct platform_driver rcar_pci_driver = {
> >         },
> >         .probe = rcar_pci_probe,
> >  };
> > -
> > -module_platform_driver(rcar_pci_driver);
> > -
> > -MODULE_LICENSE("GPL v2");
> > -MODULE_DESCRIPTION("Renesas R-Car Gen2 internal PCI");
> > -MODULE_AUTHOR("Valentine Barshak <valentine.barshak@cogentembedded.com>");
> > +builtin_platform_driver(rcar_pci_driver);
> 
> 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] 82+ messages in thread

* Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
@ 2015-12-13 18:15       ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13 18:15 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Valentine Barshak, linux-kernel, Simon Horman, Bjorn Helgaas,
	linux-pci, Linux-sh list, Joe Perches

[Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular] On 13/12/2015 (Sun 11:59) Geert Uytterhoeven wrote:

> CC MODULE_AUTHOR

Thanks, I just assumed get-maintainer.pl would have automatically
collected that up with the other names it emits.  Apparently not.

Joe: is there a reason it doesn't use the module author field?

Paul.
--

> 
> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > The Kconfig currently controlling compilation of this code is:
> >
> > drivers/pci/host/Kconfig:config PCI_RCAR_GEN2
> > drivers/pci/host/Kconfig:       bool "Renesas R-Car Gen2 Internal PCI controller"
> >
> > ...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 don't have to disallow a driver unbind, since that is already
> > done for us in this driver.
> >
> > Since module_platform_driver() uses the same init level priority as
> > builtin_platform_driver() the init ordering remains unchanged with
> > this commit.
> >
> > We don't replace module.h with init.h since the file already has that.
> >
> > 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: Simon Horman <horms@verge.net.au>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: linux-pci@vger.kernel.org
> > Cc: linux-sh@vger.kernel.org
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > ---
> >  drivers/pci/host/pci-rcar-gen2.c | 12 +++---------
> >  1 file changed, 3 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/pci/host/pci-rcar-gen2.c b/drivers/pci/host/pci-rcar-gen2.c
> > index c4f64bfee551..81dda40c7a9f 100644
> > --- a/drivers/pci/host/pci-rcar-gen2.c
> > +++ b/drivers/pci/host/pci-rcar-gen2.c
> > @@ -4,6 +4,8 @@
> >   * Copyright (C) 2013 Renesas Solutions Corp.
> >   * Copyright (C) 2013 Cogent Embedded, Inc.
> >   *
> > + * Module Author: Valentine Barshak <valentine.barshak@cogentembedded.com>
> > + *
> >   * This program is free software; you can redistribute it and/or modify
> >   * it under the terms of the GNU General Public License version 2 as
> >   * published by the Free Software Foundation.
> > @@ -14,7 +16,6 @@
> >  #include <linux/interrupt.h>
> >  #include <linux/io.h>
> >  #include <linux/kernel.h>
> > -#include <linux/module.h>
> >  #include <linux/of_pci.h>
> >  #include <linux/pci.h>
> >  #include <linux/platform_device.h>
> > @@ -366,8 +367,6 @@ static struct of_device_id rcar_pci_of_match[] = {
> >         { },
> >  };
> >
> > -MODULE_DEVICE_TABLE(of, rcar_pci_of_match);
> > -
> >  static struct platform_driver rcar_pci_driver = {
> >         .driver = {
> >                 .name = "pci-rcar-gen2",
> > @@ -376,9 +375,4 @@ static struct platform_driver rcar_pci_driver = {
> >         },
> >         .probe = rcar_pci_probe,
> >  };
> > -
> > -module_platform_driver(rcar_pci_driver);
> > -
> > -MODULE_LICENSE("GPL v2");
> > -MODULE_DESCRIPTION("Renesas R-Car Gen2 internal PCI");
> > -MODULE_AUTHOR("Valentine Barshak <valentine.barshak@cogentembedded.com>");
> > +builtin_platform_driver(rcar_pci_driver);
> 
> 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] 82+ messages in thread

* Re: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
  2015-12-13 10:58     ` Geert Uytterhoeven
@ 2015-12-13 18:20       ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13 18:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Phil Edworthy, linux-kernel, Simon Horman, Bjorn Helgaas,
	linux-pci, Linux-sh list

[Re: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular] On 13/12/2015 (Sun 11:58) Geert Uytterhoeven wrote:

> CC MODULE_AUTHOR

Yep, thanks -- I'll check for future sends to ensure get_maintainer.pl
hasn't omitted the module author.  Looks like it may emit the module
author if they have been actively committing, but that won't work in the
authored and then largely left it alone case.

P.
--

> 
> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > The Kconfig currently controlling compilation of this code is:
> >
> > drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
> > drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"
> >
> > ...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.
> >
> > We don't have to disallow a driver unbind, since that is already
> > done for us in this driver.
> >
> > 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: Simon Horman <horms@verge.net.au>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: linux-pci@vger.kernel.org
> > Cc: linux-sh@vger.kernel.org
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > ---
> >  drivers/pci/host/pcie-rcar.c | 11 ++++-------
> >  1 file changed, 4 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> > index f4fa6c537448..2c619277d265 100644
> > --- a/drivers/pci/host/pcie-rcar.c
> > +++ b/drivers/pci/host/pcie-rcar.c
> > @@ -7,6 +7,8 @@
> >   *  arch/sh/drivers/pci/ops-sh7786.c
> >   *  Copyright (C) 2009 - 2011  Paul Mundt
> >   *
> > + * Module Author: Phil Edworthy <phil.edworthy@renesas.com>
> > + *
> >   * This file is licensed under the terms of the GNU General Public
> >   * License version 2.  This program is licensed "as is" without any
> >   * warranty of any kind, whether express or implied.
> > @@ -18,7 +20,7 @@
> >  #include <linux/irq.h>
> >  #include <linux/irqdomain.h>
> >  #include <linux/kernel.h>
> > -#include <linux/module.h>
> > +#include <linux/init.h>
> >  #include <linux/msi.h>
> >  #include <linux/of_address.h>
> >  #include <linux/of_irq.h>
> > @@ -921,7 +923,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
> >         { .compatible = "renesas,pcie-r8a7791", .data = rcar_pcie_hw_init },
> >         {},
> >  };
> > -MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
> >
> >  static int rcar_pcie_probe(struct platform_device *pdev)
> >  {
> > @@ -1007,8 +1008,4 @@ static struct platform_driver rcar_pcie_driver = {
> >         },
> >         .probe = rcar_pcie_probe,
> >  };
> > -module_platform_driver(rcar_pcie_driver);
> > -
> > -MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>");
> > -MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
> > -MODULE_LICENSE("GPL v2");
> > +builtin_platform_driver(rcar_pcie_driver);
> 
> 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] 82+ messages in thread

* Re: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
@ 2015-12-13 18:20       ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-13 18:20 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Phil Edworthy, linux-kernel, Simon Horman, Bjorn Helgaas,
	linux-pci, Linux-sh list

[Re: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular] On 13/12/2015 (Sun 11:58) Geert Uytterhoeven wrote:

> CC MODULE_AUTHOR

Yep, thanks -- I'll check for future sends to ensure get_maintainer.pl
hasn't omitted the module author.  Looks like it may emit the module
author if they have been actively committing, but that won't work in the
authored and then largely left it alone case.

P.
--

> 
> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > The Kconfig currently controlling compilation of this code is:
> >
> > drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
> > drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"
> >
> > ...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.
> >
> > We don't have to disallow a driver unbind, since that is already
> > done for us in this driver.
> >
> > 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: Simon Horman <horms@verge.net.au>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: linux-pci@vger.kernel.org
> > Cc: linux-sh@vger.kernel.org
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > ---
> >  drivers/pci/host/pcie-rcar.c | 11 ++++-------
> >  1 file changed, 4 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> > index f4fa6c537448..2c619277d265 100644
> > --- a/drivers/pci/host/pcie-rcar.c
> > +++ b/drivers/pci/host/pcie-rcar.c
> > @@ -7,6 +7,8 @@
> >   *  arch/sh/drivers/pci/ops-sh7786.c
> >   *  Copyright (C) 2009 - 2011  Paul Mundt
> >   *
> > + * Module Author: Phil Edworthy <phil.edworthy@renesas.com>
> > + *
> >   * This file is licensed under the terms of the GNU General Public
> >   * License version 2.  This program is licensed "as is" without any
> >   * warranty of any kind, whether express or implied.
> > @@ -18,7 +20,7 @@
> >  #include <linux/irq.h>
> >  #include <linux/irqdomain.h>
> >  #include <linux/kernel.h>
> > -#include <linux/module.h>
> > +#include <linux/init.h>
> >  #include <linux/msi.h>
> >  #include <linux/of_address.h>
> >  #include <linux/of_irq.h>
> > @@ -921,7 +923,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
> >         { .compatible = "renesas,pcie-r8a7791", .data = rcar_pcie_hw_init },
> >         {},
> >  };
> > -MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
> >
> >  static int rcar_pcie_probe(struct platform_device *pdev)
> >  {
> > @@ -1007,8 +1008,4 @@ static struct platform_driver rcar_pcie_driver = {
> >         },
> >         .probe = rcar_pcie_probe,
> >  };
> > -module_platform_driver(rcar_pcie_driver);
> > -
> > -MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>");
> > -MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
> > -MODULE_LICENSE("GPL v2");
> > +builtin_platform_driver(rcar_pcie_driver);
> 
> 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] 82+ messages in thread

* Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
  2015-12-13 18:15       ` Paul Gortmaker
@ 2015-12-13 20:37         ` Joe Perches
  -1 siblings, 0 replies; 82+ messages in thread
From: Joe Perches @ 2015-12-13 20:37 UTC (permalink / raw)
  To: Paul Gortmaker, Geert Uytterhoeven
  Cc: Valentine Barshak, linux-kernel, Simon Horman, Bjorn Helgaas,
	linux-pci, Linux-sh list

On Sun, 2015-12-13 at 13:15 -0500, Paul Gortmaker wrote:
> [Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly
> non-modular] On 13/12/2015 (Sun 11:59) Geert Uytterhoeven wrote:
> 
> > CC MODULE_AUTHOR
> 
> Thanks, I just assumed get-maintainer.pl would have automatically
> collected that up with the other names it emits.  Apparently not.
> 
> Joe: is there a reason it doesn't use the module author field?

Because it's frequently out-of-date and the
MAINTAINERS entry is generally enough.

If you want to add it, there's an option for it
	--file-emails

> Paul

cheers, Joe


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

* Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
@ 2015-12-13 20:37         ` Joe Perches
  0 siblings, 0 replies; 82+ messages in thread
From: Joe Perches @ 2015-12-13 20:37 UTC (permalink / raw)
  To: Paul Gortmaker, Geert Uytterhoeven
  Cc: Valentine Barshak, linux-kernel, Simon Horman, Bjorn Helgaas,
	linux-pci, Linux-sh list

On Sun, 2015-12-13 at 13:15 -0500, Paul Gortmaker wrote:
> [Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly
> non-modular] On 13/12/2015 (Sun 11:59) Geert Uytterhoeven wrote:
> 
> > CC MODULE_AUTHOR
> 
> Thanks, I just assumed get-maintainer.pl would have automatically
> collected that up with the other names it emits.  Apparently not.
> 
> Joe: is there a reason it doesn't use the module author field?

Because it's frequently out-of-date and the
MAINTAINERS entry is generally enough.

If you want to add it, there's an option for it
	--file-emails

> Paul

cheers, Joe


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

* Re: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
  2015-12-13  1:41   ` Paul Gortmaker
@ 2015-12-14  5:19     ` Simon Horman
  -1 siblings, 0 replies; 82+ messages in thread
From: Simon Horman @ 2015-12-14  5:19 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Bjorn Helgaas, linux-pci, linux-sh

On Sat, Dec 12, 2015 at 08:41:54PM -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
> drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"
> 
> ...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.
> 
> We don't have to disallow a driver unbind, since that is already
> done for us in this driver.
> 
> 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: Simon Horman <horms@verge.net.au>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
@ 2015-12-14  5:19     ` Simon Horman
  0 siblings, 0 replies; 82+ messages in thread
From: Simon Horman @ 2015-12-14  5:19 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Bjorn Helgaas, linux-pci, linux-sh

On Sat, Dec 12, 2015 at 08:41:54PM -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
> drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"
> 
> ...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.
> 
> We don't have to disallow a driver unbind, since that is already
> done for us in this driver.
> 
> 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: Simon Horman <horms@verge.net.au>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
  2015-12-13  1:41   ` Paul Gortmaker
@ 2015-12-14  5:19     ` Simon Horman
  -1 siblings, 0 replies; 82+ messages in thread
From: Simon Horman @ 2015-12-14  5:19 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Bjorn Helgaas, linux-pci, linux-sh

On Sat, Dec 12, 2015 at 08:41:52PM -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_RCAR_GEN2
> drivers/pci/host/Kconfig:       bool "Renesas R-Car Gen2 Internal PCI controller"
> 
> ...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 don't have to disallow a driver unbind, since that is already
> done for us in this driver.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> We don't replace module.h with init.h since the file already has that.
> 
> 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: Simon Horman <horms@verge.net.au>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
@ 2015-12-14  5:19     ` Simon Horman
  0 siblings, 0 replies; 82+ messages in thread
From: Simon Horman @ 2015-12-14  5:19 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linux-kernel, Bjorn Helgaas, linux-pci, linux-sh

On Sat, Dec 12, 2015 at 08:41:52PM -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_RCAR_GEN2
> drivers/pci/host/Kconfig:       bool "Renesas R-Car Gen2 Internal PCI controller"
> 
> ...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 don't have to disallow a driver unbind, since that is already
> done for us in this driver.
> 
> Since module_platform_driver() uses the same init level priority as
> builtin_platform_driver() the init ordering remains unchanged with
> this commit.
> 
> We don't replace module.h with init.h since the file already has that.
> 
> 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: Simon Horman <horms@verge.net.au>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-sh@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Acked-by: Simon Horman <horms+renesas@verge.net.au>


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

* Re: [PATCH 08/10] drivers/pci: make host/pcie-xilinx.c explicitly non-modular
  2015-12-13  1:41   ` Paul Gortmaker
@ 2015-12-14  7:25     ` Michal Simek
  -1 siblings, 0 replies; 82+ messages in thread
From: Michal Simek @ 2015-12-14  7:25 UTC (permalink / raw)
  To: Paul Gortmaker, linux-kernel
  Cc: Bjorn Helgaas, Michal Simek, Sören Brinkmann, linux-pci,
	linux-arm-kernel

On 13.12.2015 02:41, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCIE_XILINX
> drivers/pci/host/Kconfig:       bool "Xilinx AXI PCIe host bridge support"
> 
> ...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.  This
> makes xilinx_pcie_free_irq_domain orphaned so we remove it too.

Right.

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

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

* [PATCH 08/10] drivers/pci: make host/pcie-xilinx.c explicitly non-modular
@ 2015-12-14  7:25     ` Michal Simek
  0 siblings, 0 replies; 82+ messages in thread
From: Michal Simek @ 2015-12-14  7:25 UTC (permalink / raw)
  To: linux-arm-kernel

On 13.12.2015 02:41, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCIE_XILINX
> drivers/pci/host/Kconfig:       bool "Xilinx AXI PCIe host bridge support"
> 
> ...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.  This
> makes xilinx_pcie_free_irq_domain orphaned so we remove it too.

Right.

Acked-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal

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

* Re: [PATCH 06/10] drivers/pci: make host/pci-tegra.c explicitly non-modular
  2015-12-13  1:41   ` Paul Gortmaker
  (?)
@ 2015-12-14  8:15   ` Thierry Reding
  -1 siblings, 0 replies; 82+ messages in thread
From: Thierry Reding @ 2015-12-14  8:15 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Bjorn Helgaas, Stephen Warren, Alexandre Courbot,
	linux-tegra, linux-pci

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

On Sat, Dec 12, 2015 at 08:41:53PM -0500, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_TEGRA
> drivers/pci/host/Kconfig:       bool "NVIDIA Tegra PCIe controller"
> 
> ...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 don't have to disallow a driver unbind, since that is already
> done for us in this driver.
> 
> 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: Thierry Reding <thierry.reding@gmail.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: linux-tegra@vger.kernel.org
> Cc: linux-pci@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/pci/host/pci-tegra.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)

I'd rather not do this. There is work underway to make it possible to
turn PCI host drivers into modules. I have a local tree with the
necessary changes and, though I suspect it might take a few releases to
get everything merged, I think we'll get there eventually.

Thierry

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

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:19   ` Geert Uytterhoeven
  0 siblings, 0 replies; 82+ messages in thread
From: Geert Uytterhoeven @ 2015-12-14  8:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> This series of commits is a slice of a larger project to ensure
> people don't have dead code for module removal in non-modular
> drivers.  Overall there was roughly 5k lines of dead code in the
> kernel due to this.  So far we've fixed several areas, like tty,
> x86, net, etc. and we continue to work on other areas.
>
> There are several reasons to not use module_init for code that can
> never be built as a module, but the big ones are:
>
>  (1) it is easy to accidentally code up 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.
>
> Here we convert some module_init() calls into device_initcall() and delete
> any module_exit and remove code that gets orphaned in the process, for
> an overall net code reduction, which is always welcome.
>
> The use of device_initcall ensures that the init function ordering
> remains unchanged, but one could argue that PCI host code might be more
> appropriate to be handled under subsys_initcall.  Fortunately we can
> revisit making this extra change at a later date if desired; it does
> not need to happen now, and we reduce the risk of introducing
> regressions at this point in time by separating the two changes.
>
> Over half of the drivers changed here already explicitly disallowed any
> unbind operations.  For the rest we make them the same, since there is
> not really any sensible use case to unbind any built-in bus support that
> I can think of.

Personally, I think all of these should become tristate, so distro kernels
don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
are becoming too big.

That does not preclude making these modules un-unloadable, though.

> Paul Gortmaker (10):
>   drivers/pci: make host/pci-imx6.c driver explicitly non-modular
>   drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular
>   drivers/pci: make host/pci-mvebu.c explicitly non-modular
>   drivers/pci: make host/pci-dra7xx.c explicitly non-modular
>   drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
>   drivers/pci: make host/pci-tegra.c explicitly non-modular
>   drivers/pci: make host/pcie-rcar.c explicitly non-modular
>   drivers/pci: make host/pcie-xilinx.c explicitly non-modular
>   drivers/pci: make host/pci-keystone.c explicitly non-modular
>   drivers/pci: make host/pcie-altera.c explicitly non-modular

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] 82+ messages in thread

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:19   ` Geert Uytterhoeven
  0 siblings, 0 replies; 82+ messages in thread
From: Geert Uytterhoeven @ 2015-12-14  8:19 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA, Linux-sh list, linux-pci,
	Thierry Reding, Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Thomas Petazzoni, Richard Zhu,
	rfi-g9ZBwUv/Ih/yUk5EbOjzuce+I+R0W71w, Ley Foon Tan

Hi Paul,

On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
<paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org> wrote:
> This series of commits is a slice of a larger project to ensure
> people don't have dead code for module removal in non-modular
> drivers.  Overall there was roughly 5k lines of dead code in the
> kernel due to this.  So far we've fixed several areas, like tty,
> x86, net, etc. and we continue to work on other areas.
>
> There are several reasons to not use module_init for code that can
> never be built as a module, but the big ones are:
>
>  (1) it is easy to accidentally code up 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.
>
> Here we convert some module_init() calls into device_initcall() and delete
> any module_exit and remove code that gets orphaned in the process, for
> an overall net code reduction, which is always welcome.
>
> The use of device_initcall ensures that the init function ordering
> remains unchanged, but one could argue that PCI host code might be more
> appropriate to be handled under subsys_initcall.  Fortunately we can
> revisit making this extra change at a later date if desired; it does
> not need to happen now, and we reduce the risk of introducing
> regressions at this point in time by separating the two changes.
>
> Over half of the drivers changed here already explicitly disallowed any
> unbind operations.  For the rest we make them the same, since there is
> not really any sensible use case to unbind any built-in bus support that
> I can think of.

Personally, I think all of these should become tristate, so distro kernels
don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
are becoming too big.

That does not preclude making these modules un-unloadable, though.

> Paul Gortmaker (10):
>   drivers/pci: make host/pci-imx6.c driver explicitly non-modular
>   drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular
>   drivers/pci: make host/pci-mvebu.c explicitly non-modular
>   drivers/pci: make host/pci-dra7xx.c explicitly non-modular
>   drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
>   drivers/pci: make host/pci-tegra.c explicitly non-modular
>   drivers/pci: make host/pcie-rcar.c explicitly non-modular
>   drivers/pci: make host/pcie-xilinx.c explicitly non-modular
>   drivers/pci: make host/pci-keystone.c explicitly non-modular
>   drivers/pci: make host/pcie-altera.c explicitly non-modular

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.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] 82+ messages in thread

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:19   ` Geert Uytterhoeven
  0 siblings, 0 replies; 82+ messages in thread
From: Geert Uytterhoeven @ 2015-12-14  8:19 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Linux-sh list, linux-pci, Thierry Reding,
	Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman, linux-tegra,
	linux-omap, linux-arm-kernel, Thomas Petazzoni, Richard Zhu, rfi,
	Ley Foon Tan, Bjorn Helgaas, Lucas Stach

Hi Paul,

On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> This series of commits is a slice of a larger project to ensure
> people don't have dead code for module removal in non-modular
> drivers.  Overall there was roughly 5k lines of dead code in the
> kernel due to this.  So far we've fixed several areas, like tty,
> x86, net, etc. and we continue to work on other areas.
>
> There are several reasons to not use module_init for code that can
> never be built as a module, but the big ones are:
>
>  (1) it is easy to accidentally code up 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.
>
> Here we convert some module_init() calls into device_initcall() and delete
> any module_exit and remove code that gets orphaned in the process, for
> an overall net code reduction, which is always welcome.
>
> The use of device_initcall ensures that the init function ordering
> remains unchanged, but one could argue that PCI host code might be more
> appropriate to be handled under subsys_initcall.  Fortunately we can
> revisit making this extra change at a later date if desired; it does
> not need to happen now, and we reduce the risk of introducing
> regressions at this point in time by separating the two changes.
>
> Over half of the drivers changed here already explicitly disallowed any
> unbind operations.  For the rest we make them the same, since there is
> not really any sensible use case to unbind any built-in bus support that
> I can think of.

Personally, I think all of these should become tristate, so distro kernels
don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
are becoming too big.

That does not preclude making these modules un-unloadable, though.

> Paul Gortmaker (10):
>   drivers/pci: make host/pci-imx6.c driver explicitly non-modular
>   drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular
>   drivers/pci: make host/pci-mvebu.c explicitly non-modular
>   drivers/pci: make host/pci-dra7xx.c explicitly non-modular
>   drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
>   drivers/pci: make host/pci-tegra.c explicitly non-modular
>   drivers/pci: make host/pcie-rcar.c explicitly non-modular
>   drivers/pci: make host/pcie-xilinx.c explicitly non-modular
>   drivers/pci: make host/pci-keystone.c explicitly non-modular
>   drivers/pci: make host/pcie-altera.c explicitly non-modular

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] 82+ messages in thread

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:19   ` Geert Uytterhoeven
  0 siblings, 0 replies; 82+ messages in thread
From: Geert Uytterhoeven @ 2015-12-14  8:19 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Paul,

On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
<paul.gortmaker@windriver.com> wrote:
> This series of commits is a slice of a larger project to ensure
> people don't have dead code for module removal in non-modular
> drivers.  Overall there was roughly 5k lines of dead code in the
> kernel due to this.  So far we've fixed several areas, like tty,
> x86, net, etc. and we continue to work on other areas.
>
> There are several reasons to not use module_init for code that can
> never be built as a module, but the big ones are:
>
>  (1) it is easy to accidentally code up 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.
>
> Here we convert some module_init() calls into device_initcall() and delete
> any module_exit and remove code that gets orphaned in the process, for
> an overall net code reduction, which is always welcome.
>
> The use of device_initcall ensures that the init function ordering
> remains unchanged, but one could argue that PCI host code might be more
> appropriate to be handled under subsys_initcall.  Fortunately we can
> revisit making this extra change at a later date if desired; it does
> not need to happen now, and we reduce the risk of introducing
> regressions at this point in time by separating the two changes.
>
> Over half of the drivers changed here already explicitly disallowed any
> unbind operations.  For the rest we make them the same, since there is
> not really any sensible use case to unbind any built-in bus support that
> I can think of.

Personally, I think all of these should become tristate, so distro kernels
don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
are becoming too big.

That does not preclude making these modules un-unloadable, though.

> Paul Gortmaker (10):
>   drivers/pci: make host/pci-imx6.c driver explicitly non-modular
>   drivers/pci: make host/pcie-spear13xx.c driver explicitly non-modular
>   drivers/pci: make host/pci-mvebu.c explicitly non-modular
>   drivers/pci: make host/pci-dra7xx.c explicitly non-modular
>   drivers/pci: make host/pci-rcar-gen2.c explicitly non-modular
>   drivers/pci: make host/pci-tegra.c explicitly non-modular
>   drivers/pci: make host/pcie-rcar.c explicitly non-modular
>   drivers/pci: make host/pcie-xilinx.c explicitly non-modular
>   drivers/pci: make host/pci-keystone.c explicitly non-modular
>   drivers/pci: make host/pcie-altera.c explicitly non-modular

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at 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] 82+ messages in thread

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
  2015-12-14  8:19   ` Geert Uytterhoeven
  (?)
  (?)
@ 2015-12-14  8:24     ` Thierry Reding
  -1 siblings, 0 replies; 82+ messages in thread
From: Thierry Reding @ 2015-12-14  8:24 UTC (permalink / raw)
  To: linux-arm-kernel

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

On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
> Hi Paul,
> 
> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > This series of commits is a slice of a larger project to ensure
> > people don't have dead code for module removal in non-modular
> > drivers.  Overall there was roughly 5k lines of dead code in the
> > kernel due to this.  So far we've fixed several areas, like tty,
> > x86, net, etc. and we continue to work on other areas.
> >
> > There are several reasons to not use module_init for code that can
> > never be built as a module, but the big ones are:
> >
> >  (1) it is easy to accidentally code up 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.
> >
> > Here we convert some module_init() calls into device_initcall() and delete
> > any module_exit and remove code that gets orphaned in the process, for
> > an overall net code reduction, which is always welcome.
> >
> > The use of device_initcall ensures that the init function ordering
> > remains unchanged, but one could argue that PCI host code might be more
> > appropriate to be handled under subsys_initcall.  Fortunately we can
> > revisit making this extra change at a later date if desired; it does
> > not need to happen now, and we reduce the risk of introducing
> > regressions at this point in time by separating the two changes.
> >
> > Over half of the drivers changed here already explicitly disallowed any
> > unbind operations.  For the rest we make them the same, since there is
> > not really any sensible use case to unbind any built-in bus support that
> > I can think of.
> 
> Personally, I think all of these should become tristate, so distro kernels
> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
> are becoming too big.
> 
> That does not preclude making these modules un-unloadable, though.

Most of these can't be made tristate as-is, because they use symbols
that aren't exported. Many of those symbols can easily be exported, so
its just a matter of getting the respective patches merged. I disagree
with making the modules non-unloadable, though. I have a local branch
with changes necessary to unload the host controller driver and it
works just fine.

Thierry

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

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:24     ` Thierry Reding
  0 siblings, 0 replies; 82+ messages in thread
From: Thierry Reding @ 2015-12-14  8:24 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Paul Gortmaker, linux-kernel, Linux-sh list, linux-pci,
	Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman, linux-tegra,
	linux-omap, linux-arm-kernel, Thomas Petazzoni, Richard Zhu, rfi

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

On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
> Hi Paul,
> 
> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > This series of commits is a slice of a larger project to ensure
> > people don't have dead code for module removal in non-modular
> > drivers.  Overall there was roughly 5k lines of dead code in the
> > kernel due to this.  So far we've fixed several areas, like tty,
> > x86, net, etc. and we continue to work on other areas.
> >
> > There are several reasons to not use module_init for code that can
> > never be built as a module, but the big ones are:
> >
> >  (1) it is easy to accidentally code up 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.
> >
> > Here we convert some module_init() calls into device_initcall() and delete
> > any module_exit and remove code that gets orphaned in the process, for
> > an overall net code reduction, which is always welcome.
> >
> > The use of device_initcall ensures that the init function ordering
> > remains unchanged, but one could argue that PCI host code might be more
> > appropriate to be handled under subsys_initcall.  Fortunately we can
> > revisit making this extra change at a later date if desired; it does
> > not need to happen now, and we reduce the risk of introducing
> > regressions at this point in time by separating the two changes.
> >
> > Over half of the drivers changed here already explicitly disallowed any
> > unbind operations.  For the rest we make them the same, since there is
> > not really any sensible use case to unbind any built-in bus support that
> > I can think of.
> 
> Personally, I think all of these should become tristate, so distro kernels
> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
> are becoming too big.
> 
> That does not preclude making these modules un-unloadable, though.

Most of these can't be made tristate as-is, because they use symbols
that aren't exported. Many of those symbols can easily be exported, so
its just a matter of getting the respective patches merged. I disagree
with making the modules non-unloadable, though. I have a local branch
with changes necessary to unload the host controller driver and it
works just fine.

Thierry

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

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:24     ` Thierry Reding
  0 siblings, 0 replies; 82+ messages in thread
From: Thierry Reding @ 2015-12-14  8:24 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Paul Gortmaker, linux-kernel, Linux-sh list, linux-pci,
	Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman, linux-tegra,
	linux-omap, linux-arm-kernel, Thomas Petazzoni, Richard Zhu, rfi,
	Ley Foon Tan, Bjorn Helgaas, Lucas Stach

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

On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
> Hi Paul,
> 
> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > This series of commits is a slice of a larger project to ensure
> > people don't have dead code for module removal in non-modular
> > drivers.  Overall there was roughly 5k lines of dead code in the
> > kernel due to this.  So far we've fixed several areas, like tty,
> > x86, net, etc. and we continue to work on other areas.
> >
> > There are several reasons to not use module_init for code that can
> > never be built as a module, but the big ones are:
> >
> >  (1) it is easy to accidentally code up 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.
> >
> > Here we convert some module_init() calls into device_initcall() and delete
> > any module_exit and remove code that gets orphaned in the process, for
> > an overall net code reduction, which is always welcome.
> >
> > The use of device_initcall ensures that the init function ordering
> > remains unchanged, but one could argue that PCI host code might be more
> > appropriate to be handled under subsys_initcall.  Fortunately we can
> > revisit making this extra change at a later date if desired; it does
> > not need to happen now, and we reduce the risk of introducing
> > regressions at this point in time by separating the two changes.
> >
> > Over half of the drivers changed here already explicitly disallowed any
> > unbind operations.  For the rest we make them the same, since there is
> > not really any sensible use case to unbind any built-in bus support that
> > I can think of.
> 
> Personally, I think all of these should become tristate, so distro kernels
> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
> are becoming too big.
> 
> That does not preclude making these modules un-unloadable, though.

Most of these can't be made tristate as-is, because they use symbols
that aren't exported. Many of those symbols can easily be exported, so
its just a matter of getting the respective patches merged. I disagree
with making the modules non-unloadable, though. I have a local branch
with changes necessary to unload the host controller driver and it
works just fine.

Thierry

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

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

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:24     ` Thierry Reding
  0 siblings, 0 replies; 82+ messages in thread
From: Thierry Reding @ 2015-12-14  8:24 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
> Hi Paul,
> 
> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > This series of commits is a slice of a larger project to ensure
> > people don't have dead code for module removal in non-modular
> > drivers.  Overall there was roughly 5k lines of dead code in the
> > kernel due to this.  So far we've fixed several areas, like tty,
> > x86, net, etc. and we continue to work on other areas.
> >
> > There are several reasons to not use module_init for code that can
> > never be built as a module, but the big ones are:
> >
> >  (1) it is easy to accidentally code up 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.
> >
> > Here we convert some module_init() calls into device_initcall() and delete
> > any module_exit and remove code that gets orphaned in the process, for
> > an overall net code reduction, which is always welcome.
> >
> > The use of device_initcall ensures that the init function ordering
> > remains unchanged, but one could argue that PCI host code might be more
> > appropriate to be handled under subsys_initcall.  Fortunately we can
> > revisit making this extra change at a later date if desired; it does
> > not need to happen now, and we reduce the risk of introducing
> > regressions at this point in time by separating the two changes.
> >
> > Over half of the drivers changed here already explicitly disallowed any
> > unbind operations.  For the rest we make them the same, since there is
> > not really any sensible use case to unbind any built-in bus support that
> > I can think of.
> 
> Personally, I think all of these should become tristate, so distro kernels
> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
> are becoming too big.
> 
> That does not preclude making these modules un-unloadable, though.

Most of these can't be made tristate as-is, because they use symbols
that aren't exported. Many of those symbols can easily be exported, so
its just a matter of getting the respective patches merged. I disagree
with making the modules non-unloadable, though. I have a local branch
with changes necessary to unload the host controller driver and it
works just fine.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151214/21036b5d/attachment.sig>

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
  2015-12-14  8:24     ` Thierry Reding
  (?)
  (?)
@ 2015-12-14  8:26       ` Michal Simek
  -1 siblings, 0 replies; 82+ messages in thread
From: Michal Simek @ 2015-12-14  8:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 14.12.2015 09:24, Thierry Reding wrote:
> On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
>> Hi Paul,
>>
>> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
>> <paul.gortmaker@windriver.com> wrote:
>>> This series of commits is a slice of a larger project to ensure
>>> people don't have dead code for module removal in non-modular
>>> drivers.  Overall there was roughly 5k lines of dead code in the
>>> kernel due to this.  So far we've fixed several areas, like tty,
>>> x86, net, etc. and we continue to work on other areas.
>>>
>>> There are several reasons to not use module_init for code that can
>>> never be built as a module, but the big ones are:
>>>
>>>  (1) it is easy to accidentally code up 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.
>>>
>>> Here we convert some module_init() calls into device_initcall() and delete
>>> any module_exit and remove code that gets orphaned in the process, for
>>> an overall net code reduction, which is always welcome.
>>>
>>> The use of device_initcall ensures that the init function ordering
>>> remains unchanged, but one could argue that PCI host code might be more
>>> appropriate to be handled under subsys_initcall.  Fortunately we can
>>> revisit making this extra change at a later date if desired; it does
>>> not need to happen now, and we reduce the risk of introducing
>>> regressions at this point in time by separating the two changes.
>>>
>>> Over half of the drivers changed here already explicitly disallowed any
>>> unbind operations.  For the rest we make them the same, since there is
>>> not really any sensible use case to unbind any built-in bus support that
>>> I can think of.
>>
>> Personally, I think all of these should become tristate, so distro kernels
>> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
>> are becoming too big.
>>
>> That does not preclude making these modules un-unloadable, though.
> 
> Most of these can't be made tristate as-is, because they use symbols
> that aren't exported. Many of those symbols can easily be exported, so
> its just a matter of getting the respective patches merged. I disagree
> with making the modules non-unloadable, though. I have a local branch
> with changes necessary to unload the host controller driver and it
> works just fine.

Great.

Send them out.

Thanks,
Michal


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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:26       ` Michal Simek
  0 siblings, 0 replies; 82+ messages in thread
From: Michal Simek @ 2015-12-14  8:26 UTC (permalink / raw)
  To: Thierry Reding, Geert Uytterhoeven
  Cc: Paul Gortmaker, linux-kernel, Linux-sh list, linux-pci,
	Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman, linux-tegra,
	linux-omap, linux-arm-kernel, Thomas Petazzoni, Richard Zhu, rfi

On 14.12.2015 09:24, Thierry Reding wrote:
> On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
>> Hi Paul,
>>
>> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
>> <paul.gortmaker@windriver.com> wrote:
>>> This series of commits is a slice of a larger project to ensure
>>> people don't have dead code for module removal in non-modular
>>> drivers.  Overall there was roughly 5k lines of dead code in the
>>> kernel due to this.  So far we've fixed several areas, like tty,
>>> x86, net, etc. and we continue to work on other areas.
>>>
>>> There are several reasons to not use module_init for code that can
>>> never be built as a module, but the big ones are:
>>>
>>>  (1) it is easy to accidentally code up 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.
>>>
>>> Here we convert some module_init() calls into device_initcall() and delete
>>> any module_exit and remove code that gets orphaned in the process, for
>>> an overall net code reduction, which is always welcome.
>>>
>>> The use of device_initcall ensures that the init function ordering
>>> remains unchanged, but one could argue that PCI host code might be more
>>> appropriate to be handled under subsys_initcall.  Fortunately we can
>>> revisit making this extra change at a later date if desired; it does
>>> not need to happen now, and we reduce the risk of introducing
>>> regressions at this point in time by separating the two changes.
>>>
>>> Over half of the drivers changed here already explicitly disallowed any
>>> unbind operations.  For the rest we make them the same, since there is
>>> not really any sensible use case to unbind any built-in bus support that
>>> I can think of.
>>
>> Personally, I think all of these should become tristate, so distro kernels
>> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
>> are becoming too big.
>>
>> That does not preclude making these modules un-unloadable, though.
> 
> Most of these can't be made tristate as-is, because they use symbols
> that aren't exported. Many of those symbols can easily be exported, so
> its just a matter of getting the respective patches merged. I disagree
> with making the modules non-unloadable, though. I have a local branch
> with changes necessary to unload the host controller driver and it
> works just fine.

Great.

Send them out.

Thanks,
Michal

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:26       ` Michal Simek
  0 siblings, 0 replies; 82+ messages in thread
From: Michal Simek @ 2015-12-14  8:26 UTC (permalink / raw)
  To: Thierry Reding, Geert Uytterhoeven
  Cc: Paul Gortmaker, linux-kernel, Linux-sh list, linux-pci,
	Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman, linux-tegra,
	linux-omap, linux-arm-kernel, Thomas Petazzoni, Richard Zhu, rfi,
	Ley Foon Tan, Bjorn Helgaas, Lucas Stach

On 14.12.2015 09:24, Thierry Reding wrote:
> On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
>> Hi Paul,
>>
>> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
>> <paul.gortmaker@windriver.com> wrote:
>>> This series of commits is a slice of a larger project to ensure
>>> people don't have dead code for module removal in non-modular
>>> drivers.  Overall there was roughly 5k lines of dead code in the
>>> kernel due to this.  So far we've fixed several areas, like tty,
>>> x86, net, etc. and we continue to work on other areas.
>>>
>>> There are several reasons to not use module_init for code that can
>>> never be built as a module, but the big ones are:
>>>
>>>  (1) it is easy to accidentally code up 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.
>>>
>>> Here we convert some module_init() calls into device_initcall() and delete
>>> any module_exit and remove code that gets orphaned in the process, for
>>> an overall net code reduction, which is always welcome.
>>>
>>> The use of device_initcall ensures that the init function ordering
>>> remains unchanged, but one could argue that PCI host code might be more
>>> appropriate to be handled under subsys_initcall.  Fortunately we can
>>> revisit making this extra change at a later date if desired; it does
>>> not need to happen now, and we reduce the risk of introducing
>>> regressions at this point in time by separating the two changes.
>>>
>>> Over half of the drivers changed here already explicitly disallowed any
>>> unbind operations.  For the rest we make them the same, since there is
>>> not really any sensible use case to unbind any built-in bus support that
>>> I can think of.
>>
>> Personally, I think all of these should become tristate, so distro kernels
>> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
>> are becoming too big.
>>
>> That does not preclude making these modules un-unloadable, though.
> 
> Most of these can't be made tristate as-is, because they use symbols
> that aren't exported. Many of those symbols can easily be exported, so
> its just a matter of getting the respective patches merged. I disagree
> with making the modules non-unloadable, though. I have a local branch
> with changes necessary to unload the host controller driver and it
> works just fine.

Great.

Send them out.

Thanks,
Michal


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

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:26       ` Michal Simek
  0 siblings, 0 replies; 82+ messages in thread
From: Michal Simek @ 2015-12-14  8:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 14.12.2015 09:24, Thierry Reding wrote:
> On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
>> Hi Paul,
>>
>> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
>> <paul.gortmaker@windriver.com> wrote:
>>> This series of commits is a slice of a larger project to ensure
>>> people don't have dead code for module removal in non-modular
>>> drivers.  Overall there was roughly 5k lines of dead code in the
>>> kernel due to this.  So far we've fixed several areas, like tty,
>>> x86, net, etc. and we continue to work on other areas.
>>>
>>> There are several reasons to not use module_init for code that can
>>> never be built as a module, but the big ones are:
>>>
>>>  (1) it is easy to accidentally code up 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.
>>>
>>> Here we convert some module_init() calls into device_initcall() and delete
>>> any module_exit and remove code that gets orphaned in the process, for
>>> an overall net code reduction, which is always welcome.
>>>
>>> The use of device_initcall ensures that the init function ordering
>>> remains unchanged, but one could argue that PCI host code might be more
>>> appropriate to be handled under subsys_initcall.  Fortunately we can
>>> revisit making this extra change at a later date if desired; it does
>>> not need to happen now, and we reduce the risk of introducing
>>> regressions at this point in time by separating the two changes.
>>>
>>> Over half of the drivers changed here already explicitly disallowed any
>>> unbind operations.  For the rest we make them the same, since there is
>>> not really any sensible use case to unbind any built-in bus support that
>>> I can think of.
>>
>> Personally, I think all of these should become tristate, so distro kernels
>> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
>> are becoming too big.
>>
>> That does not preclude making these modules un-unloadable, though.
> 
> Most of these can't be made tristate as-is, because they use symbols
> that aren't exported. Many of those symbols can easily be exported, so
> its just a matter of getting the respective patches merged. I disagree
> with making the modules non-unloadable, though. I have a local branch
> with changes necessary to unload the host controller driver and it
> works just fine.

Great.

Send them out.

Thanks,
Michal

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
  2015-12-14  8:24     ` Thierry Reding
  (?)
  (?)
@ 2015-12-14  8:33       ` Ley Foon Tan
  -1 siblings, 0 replies; 82+ messages in thread
From: Ley Foon Tan @ 2015-12-14  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 14, 2015 at 4:24 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
>> Hi Paul,
>>
>> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
>> <paul.gortmaker@windriver.com> wrote:
>> > This series of commits is a slice of a larger project to ensure
>> > people don't have dead code for module removal in non-modular
>> > drivers.  Overall there was roughly 5k lines of dead code in the
>> > kernel due to this.  So far we've fixed several areas, like tty,
>> > x86, net, etc. and we continue to work on other areas.
>> >
>> > There are several reasons to not use module_init for code that can
>> > never be built as a module, but the big ones are:
>> >
>> >  (1) it is easy to accidentally code up 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.
>> >
>> > Here we convert some module_init() calls into device_initcall() and delete
>> > any module_exit and remove code that gets orphaned in the process, for
>> > an overall net code reduction, which is always welcome.
>> >
>> > The use of device_initcall ensures that the init function ordering
>> > remains unchanged, but one could argue that PCI host code might be more
>> > appropriate to be handled under subsys_initcall.  Fortunately we can
>> > revisit making this extra change at a later date if desired; it does
>> > not need to happen now, and we reduce the risk of introducing
>> > regressions at this point in time by separating the two changes.
>> >
>> > Over half of the drivers changed here already explicitly disallowed any
>> > unbind operations.  For the rest we make them the same, since there is
>> > not really any sensible use case to unbind any built-in bus support that
>> > I can think of.
>>
>> Personally, I think all of these should become tristate, so distro kernels
>> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
>> are becoming too big.
>>
>> That does not preclude making these modules un-unloadable, though.
>
> Most of these can't be made tristate as-is, because they use symbols
> that aren't exported. Many of those symbols can easily be exported, so
> its just a matter of getting the respective patches merged. I disagree
> with making the modules non-unloadable, though. I have a local branch
> with changes necessary to unload the host controller driver and it
> works just fine.
>
PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
Fixup region is in kernel region and this region if not updated when
loading a module.

Regards
Ley Foon

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:33       ` Ley Foon Tan
  0 siblings, 0 replies; 82+ messages in thread
From: Ley Foon Tan @ 2015-12-14  8:33 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Geert Uytterhoeven, Paul Gortmaker, linux-kernel, Linux-sh list,
	linux-pci, Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman, linux-tegra,
	linux-omap, linux-arm-kernel, Thomas Petazzoni, Richard Zhu

On Mon, Dec 14, 2015 at 4:24 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
>> Hi Paul,
>>
>> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
>> <paul.gortmaker@windriver.com> wrote:
>> > This series of commits is a slice of a larger project to ensure
>> > people don't have dead code for module removal in non-modular
>> > drivers.  Overall there was roughly 5k lines of dead code in the
>> > kernel due to this.  So far we've fixed several areas, like tty,
>> > x86, net, etc. and we continue to work on other areas.
>> >
>> > There are several reasons to not use module_init for code that can
>> > never be built as a module, but the big ones are:
>> >
>> >  (1) it is easy to accidentally code up 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.
>> >
>> > Here we convert some module_init() calls into device_initcall() and delete
>> > any module_exit and remove code that gets orphaned in the process, for
>> > an overall net code reduction, which is always welcome.
>> >
>> > The use of device_initcall ensures that the init function ordering
>> > remains unchanged, but one could argue that PCI host code might be more
>> > appropriate to be handled under subsys_initcall.  Fortunately we can
>> > revisit making this extra change at a later date if desired; it does
>> > not need to happen now, and we reduce the risk of introducing
>> > regressions at this point in time by separating the two changes.
>> >
>> > Over half of the drivers changed here already explicitly disallowed any
>> > unbind operations.  For the rest we make them the same, since there is
>> > not really any sensible use case to unbind any built-in bus support that
>> > I can think of.
>>
>> Personally, I think all of these should become tristate, so distro kernels
>> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
>> are becoming too big.
>>
>> That does not preclude making these modules un-unloadable, though.
>
> Most of these can't be made tristate as-is, because they use symbols
> that aren't exported. Many of those symbols can easily be exported, so
> its just a matter of getting the respective patches merged. I disagree
> with making the modules non-unloadable, though. I have a local branch
> with changes necessary to unload the host controller driver and it
> works just fine.
>
PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
Fixup region is in kernel region and this region if not updated when
loading a module.

Regards
Ley Foon

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:33       ` Ley Foon Tan
  0 siblings, 0 replies; 82+ messages in thread
From: Ley Foon Tan @ 2015-12-14  8:33 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Geert Uytterhoeven, Paul Gortmaker, linux-kernel, Linux-sh list,
	linux-pci, Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman, linux-tegra,
	linux-omap, linux-arm-kernel, Thomas Petazzoni, Richard Zhu,
	Rocketboard Maillist, Bjorn Helgaas, Lucas Stach

On Mon, Dec 14, 2015 at 4:24 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
>> Hi Paul,
>>
>> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
>> <paul.gortmaker@windriver.com> wrote:
>> > This series of commits is a slice of a larger project to ensure
>> > people don't have dead code for module removal in non-modular
>> > drivers.  Overall there was roughly 5k lines of dead code in the
>> > kernel due to this.  So far we've fixed several areas, like tty,
>> > x86, net, etc. and we continue to work on other areas.
>> >
>> > There are several reasons to not use module_init for code that can
>> > never be built as a module, but the big ones are:
>> >
>> >  (1) it is easy to accidentally code up 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.
>> >
>> > Here we convert some module_init() calls into device_initcall() and delete
>> > any module_exit and remove code that gets orphaned in the process, for
>> > an overall net code reduction, which is always welcome.
>> >
>> > The use of device_initcall ensures that the init function ordering
>> > remains unchanged, but one could argue that PCI host code might be more
>> > appropriate to be handled under subsys_initcall.  Fortunately we can
>> > revisit making this extra change at a later date if desired; it does
>> > not need to happen now, and we reduce the risk of introducing
>> > regressions at this point in time by separating the two changes.
>> >
>> > Over half of the drivers changed here already explicitly disallowed any
>> > unbind operations.  For the rest we make them the same, since there is
>> > not really any sensible use case to unbind any built-in bus support that
>> > I can think of.
>>
>> Personally, I think all of these should become tristate, so distro kernels
>> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
>> are becoming too big.
>>
>> That does not preclude making these modules un-unloadable, though.
>
> Most of these can't be made tristate as-is, because they use symbols
> that aren't exported. Many of those symbols can easily be exported, so
> its just a matter of getting the respective patches merged. I disagree
> with making the modules non-unloadable, though. I have a local branch
> with changes necessary to unload the host controller driver and it
> works just fine.
>
PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
Fixup region is in kernel region and this region if not updated when
loading a module.

Regards
Ley Foon

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

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  8:33       ` Ley Foon Tan
  0 siblings, 0 replies; 82+ messages in thread
From: Ley Foon Tan @ 2015-12-14  8:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 14, 2015 at 4:24 PM, Thierry Reding
<thierry.reding@gmail.com> wrote:
> On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
>> Hi Paul,
>>
>> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
>> <paul.gortmaker@windriver.com> wrote:
>> > This series of commits is a slice of a larger project to ensure
>> > people don't have dead code for module removal in non-modular
>> > drivers.  Overall there was roughly 5k lines of dead code in the
>> > kernel due to this.  So far we've fixed several areas, like tty,
>> > x86, net, etc. and we continue to work on other areas.
>> >
>> > There are several reasons to not use module_init for code that can
>> > never be built as a module, but the big ones are:
>> >
>> >  (1) it is easy to accidentally code up 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.
>> >
>> > Here we convert some module_init() calls into device_initcall() and delete
>> > any module_exit and remove code that gets orphaned in the process, for
>> > an overall net code reduction, which is always welcome.
>> >
>> > The use of device_initcall ensures that the init function ordering
>> > remains unchanged, but one could argue that PCI host code might be more
>> > appropriate to be handled under subsys_initcall.  Fortunately we can
>> > revisit making this extra change at a later date if desired; it does
>> > not need to happen now, and we reduce the risk of introducing
>> > regressions at this point in time by separating the two changes.
>> >
>> > Over half of the drivers changed here already explicitly disallowed any
>> > unbind operations.  For the rest we make them the same, since there is
>> > not really any sensible use case to unbind any built-in bus support that
>> > I can think of.
>>
>> Personally, I think all of these should become tristate, so distro kernels
>> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
>> are becoming too big.
>>
>> That does not preclude making these modules un-unloadable, though.
>
> Most of these can't be made tristate as-is, because they use symbols
> that aren't exported. Many of those symbols can easily be exported, so
> its just a matter of getting the respective patches merged. I disagree
> with making the modules non-unloadable, though. I have a local branch
> with changes necessary to unload the host controller driver and it
> works just fine.
>
PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
Fixup region is in kernel region and this region if not updated when
loading a module.

Regards
Ley Foon

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

* Re: [PATCH 01/10] drivers/pci: make host/pci-imx6.c driver explicitly non-modular
  2015-12-13  1:41   ` Paul Gortmaker
@ 2015-12-14  8:52     ` Arnd Bergmann
  -1 siblings, 0 replies; 82+ messages in thread
From: Arnd Bergmann @ 2015-12-14  8:52 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Paul Gortmaker, linux-kernel, linux-pci, Richard Zhu,
	Bjorn Helgaas, Lucas Stach

On Saturday 12 December 2015 20:41:48 Paul Gortmaker wrote:
> The Kconfig for this option is currently:
> 
> config PCI_IMX6
>         bool "Freescale i.MX6 PCIe controller"
> 
> ...meaning that it currently is not being built as a module by anyone.
> Lets remove the couple traces of modularity, so that when reading the
> driver there is no doubt it is builtin-only.

Can you fix Kconfig instead?

	Arnd

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

* [PATCH 01/10] drivers/pci: make host/pci-imx6.c driver explicitly non-modular
@ 2015-12-14  8:52     ` Arnd Bergmann
  0 siblings, 0 replies; 82+ messages in thread
From: Arnd Bergmann @ 2015-12-14  8:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday 12 December 2015 20:41:48 Paul Gortmaker wrote:
> The Kconfig for this option is currently:
> 
> config PCI_IMX6
>         bool "Freescale i.MX6 PCIe controller"
> 
> ...meaning that it currently is not being built as a module by anyone.
> Lets remove the couple traces of modularity, so that when reading the
> driver there is no doubt it is builtin-only.

Can you fix Kconfig instead?

	Arnd

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

* Re: [PATCH 03/10] drivers/pci: make host/pci-mvebu.c explicitly non-modular
  2015-12-13  1:41   ` Paul Gortmaker
@ 2015-12-14  8:54     ` Arnd Bergmann
  -1 siblings, 0 replies; 82+ messages in thread
From: Arnd Bergmann @ 2015-12-14  8:54 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: Paul Gortmaker, linux-kernel, Thomas Petazzoni, Jason Cooper,
	linux-pci, Bjorn Helgaas

On Saturday 12 December 2015 20:41:50 Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_MVEBU
> drivers/pci/host/Kconfig:       bool "Marvell EBU PCIe controller"
> 
> ...meaning that it currently is not being built as a module by anyone.

Here too. I think we should really try to let all PCI host drivers be
loadable modules if possible. The module unload path is currently
a bit iffy because of the way it interacts with the arch/arm PCI
infrastructure, but we are in the process of fixing it.

For now, I think allowing all PCIe host drivers for ARM to be
loadable but non-removably modules would be ideal.

	Arnd

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

* [PATCH 03/10] drivers/pci: make host/pci-mvebu.c explicitly non-modular
@ 2015-12-14  8:54     ` Arnd Bergmann
  0 siblings, 0 replies; 82+ messages in thread
From: Arnd Bergmann @ 2015-12-14  8:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Saturday 12 December 2015 20:41:50 Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_MVEBU
> drivers/pci/host/Kconfig:       bool "Marvell EBU PCIe controller"
> 
> ...meaning that it currently is not being built as a module by anyone.

Here too. I think we should really try to let all PCI host drivers be
loadable modules if possible. The module unload path is currently
a bit iffy because of the way it interacts with the arch/arm PCI
infrastructure, but we are in the process of fixing it.

For now, I think allowing all PCIe host drivers for ARM to be
loadable but non-removably modules would be ideal.

	Arnd

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
  2015-12-14  8:33       ` Ley Foon Tan
  (?)
  (?)
@ 2015-12-14  9:19         ` Thierry Reding
  -1 siblings, 0 replies; 82+ messages in thread
From: Thierry Reding @ 2015-12-14  9:19 UTC (permalink / raw)
  To: linux-arm-kernel

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

On Mon, Dec 14, 2015 at 04:33:51PM +0800, Ley Foon Tan wrote:
> On Mon, Dec 14, 2015 at 4:24 PM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> > On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
> >> Hi Paul,
> >>
> >> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> >> <paul.gortmaker@windriver.com> wrote:
> >> > This series of commits is a slice of a larger project to ensure
> >> > people don't have dead code for module removal in non-modular
> >> > drivers.  Overall there was roughly 5k lines of dead code in the
> >> > kernel due to this.  So far we've fixed several areas, like tty,
> >> > x86, net, etc. and we continue to work on other areas.
> >> >
> >> > There are several reasons to not use module_init for code that can
> >> > never be built as a module, but the big ones are:
> >> >
> >> >  (1) it is easy to accidentally code up 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.
> >> >
> >> > Here we convert some module_init() calls into device_initcall() and delete
> >> > any module_exit and remove code that gets orphaned in the process, for
> >> > an overall net code reduction, which is always welcome.
> >> >
> >> > The use of device_initcall ensures that the init function ordering
> >> > remains unchanged, but one could argue that PCI host code might be more
> >> > appropriate to be handled under subsys_initcall.  Fortunately we can
> >> > revisit making this extra change at a later date if desired; it does
> >> > not need to happen now, and we reduce the risk of introducing
> >> > regressions at this point in time by separating the two changes.
> >> >
> >> > Over half of the drivers changed here already explicitly disallowed any
> >> > unbind operations.  For the rest we make them the same, since there is
> >> > not really any sensible use case to unbind any built-in bus support that
> >> > I can think of.
> >>
> >> Personally, I think all of these should become tristate, so distro kernels
> >> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
> >> are becoming too big.
> >>
> >> That does not preclude making these modules un-unloadable, though.
> >
> > Most of these can't be made tristate as-is, because they use symbols
> > that aren't exported. Many of those symbols can easily be exported, so
> > its just a matter of getting the respective patches merged. I disagree
> > with making the modules non-unloadable, though. I have a local branch
> > with changes necessary to unload the host controller driver and it
> > works just fine.
> >
> PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> Fixup region is in kernel region and this region if not updated when
> loading a module.

Interesting, I hadn't thought about that. I suppose this means that the
module will end up containing an unused section with the fixup code. It
might be useful to add a way for that to trigger a warning at build
time.

Perhaps to fix this a mechanism could be introduced to add a table of
fixups to a host controller driver and that will get applied to all
children of the bridge. It could be problematic to cover all of the
different fixup stages, though.

Thierry

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

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  9:19         ` Thierry Reding
  0 siblings, 0 replies; 82+ messages in thread
From: Thierry Reding @ 2015-12-14  9:19 UTC (permalink / raw)
  To: Ley Foon Tan
  Cc: Geert Uytterhoeven, Paul Gortmaker, linux-kernel, Linux-sh list,
	linux-pci, Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman, linux-tegra,
	linux-omap, linux-arm-kernel, Thomas Petazzoni, Richard Zhu

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

On Mon, Dec 14, 2015 at 04:33:51PM +0800, Ley Foon Tan wrote:
> On Mon, Dec 14, 2015 at 4:24 PM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> > On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
> >> Hi Paul,
> >>
> >> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> >> <paul.gortmaker@windriver.com> wrote:
> >> > This series of commits is a slice of a larger project to ensure
> >> > people don't have dead code for module removal in non-modular
> >> > drivers.  Overall there was roughly 5k lines of dead code in the
> >> > kernel due to this.  So far we've fixed several areas, like tty,
> >> > x86, net, etc. and we continue to work on other areas.
> >> >
> >> > There are several reasons to not use module_init for code that can
> >> > never be built as a module, but the big ones are:
> >> >
> >> >  (1) it is easy to accidentally code up 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.
> >> >
> >> > Here we convert some module_init() calls into device_initcall() and delete
> >> > any module_exit and remove code that gets orphaned in the process, for
> >> > an overall net code reduction, which is always welcome.
> >> >
> >> > The use of device_initcall ensures that the init function ordering
> >> > remains unchanged, but one could argue that PCI host code might be more
> >> > appropriate to be handled under subsys_initcall.  Fortunately we can
> >> > revisit making this extra change at a later date if desired; it does
> >> > not need to happen now, and we reduce the risk of introducing
> >> > regressions at this point in time by separating the two changes.
> >> >
> >> > Over half of the drivers changed here already explicitly disallowed any
> >> > unbind operations.  For the rest we make them the same, since there is
> >> > not really any sensible use case to unbind any built-in bus support that
> >> > I can think of.
> >>
> >> Personally, I think all of these should become tristate, so distro kernels
> >> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
> >> are becoming too big.
> >>
> >> That does not preclude making these modules un-unloadable, though.
> >
> > Most of these can't be made tristate as-is, because they use symbols
> > that aren't exported. Many of those symbols can easily be exported, so
> > its just a matter of getting the respective patches merged. I disagree
> > with making the modules non-unloadable, though. I have a local branch
> > with changes necessary to unload the host controller driver and it
> > works just fine.
> >
> PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> Fixup region is in kernel region and this region if not updated when
> loading a module.

Interesting, I hadn't thought about that. I suppose this means that the
module will end up containing an unused section with the fixup code. It
might be useful to add a way for that to trigger a warning at build
time.

Perhaps to fix this a mechanism could be introduced to add a table of
fixups to a host controller driver and that will get applied to all
children of the bridge. It could be problematic to cover all of the
different fixup stages, though.

Thierry

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

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  9:19         ` Thierry Reding
  0 siblings, 0 replies; 82+ messages in thread
From: Thierry Reding @ 2015-12-14  9:19 UTC (permalink / raw)
  To: Ley Foon Tan
  Cc: Geert Uytterhoeven, Paul Gortmaker, linux-kernel, Linux-sh list,
	linux-pci, Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman, linux-tegra,
	linux-omap, linux-arm-kernel, Thomas Petazzoni, Richard Zhu,
	Rocketboard Maillist, Bjorn Helgaas, Lucas Stach

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

On Mon, Dec 14, 2015 at 04:33:51PM +0800, Ley Foon Tan wrote:
> On Mon, Dec 14, 2015 at 4:24 PM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> > On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
> >> Hi Paul,
> >>
> >> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> >> <paul.gortmaker@windriver.com> wrote:
> >> > This series of commits is a slice of a larger project to ensure
> >> > people don't have dead code for module removal in non-modular
> >> > drivers.  Overall there was roughly 5k lines of dead code in the
> >> > kernel due to this.  So far we've fixed several areas, like tty,
> >> > x86, net, etc. and we continue to work on other areas.
> >> >
> >> > There are several reasons to not use module_init for code that can
> >> > never be built as a module, but the big ones are:
> >> >
> >> >  (1) it is easy to accidentally code up 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.
> >> >
> >> > Here we convert some module_init() calls into device_initcall() and delete
> >> > any module_exit and remove code that gets orphaned in the process, for
> >> > an overall net code reduction, which is always welcome.
> >> >
> >> > The use of device_initcall ensures that the init function ordering
> >> > remains unchanged, but one could argue that PCI host code might be more
> >> > appropriate to be handled under subsys_initcall.  Fortunately we can
> >> > revisit making this extra change at a later date if desired; it does
> >> > not need to happen now, and we reduce the risk of introducing
> >> > regressions at this point in time by separating the two changes.
> >> >
> >> > Over half of the drivers changed here already explicitly disallowed any
> >> > unbind operations.  For the rest we make them the same, since there is
> >> > not really any sensible use case to unbind any built-in bus support that
> >> > I can think of.
> >>
> >> Personally, I think all of these should become tristate, so distro kernels
> >> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
> >> are becoming too big.
> >>
> >> That does not preclude making these modules un-unloadable, though.
> >
> > Most of these can't be made tristate as-is, because they use symbols
> > that aren't exported. Many of those symbols can easily be exported, so
> > its just a matter of getting the respective patches merged. I disagree
> > with making the modules non-unloadable, though. I have a local branch
> > with changes necessary to unload the host controller driver and it
> > works just fine.
> >
> PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> Fixup region is in kernel region and this region if not updated when
> loading a module.

Interesting, I hadn't thought about that. I suppose this means that the
module will end up containing an unused section with the fixup code. It
might be useful to add a way for that to trigger a warning at build
time.

Perhaps to fix this a mechanism could be introduced to add a table of
fixups to a host controller driver and that will get applied to all
children of the bridge. It could be problematic to cover all of the
different fixup stages, though.

Thierry

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

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

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14  9:19         ` Thierry Reding
  0 siblings, 0 replies; 82+ messages in thread
From: Thierry Reding @ 2015-12-14  9:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 14, 2015 at 04:33:51PM +0800, Ley Foon Tan wrote:
> On Mon, Dec 14, 2015 at 4:24 PM, Thierry Reding
> <thierry.reding@gmail.com> wrote:
> > On Mon, Dec 14, 2015 at 09:19:30AM +0100, Geert Uytterhoeven wrote:
> >> Hi Paul,
> >>
> >> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> >> <paul.gortmaker@windriver.com> wrote:
> >> > This series of commits is a slice of a larger project to ensure
> >> > people don't have dead code for module removal in non-modular
> >> > drivers.  Overall there was roughly 5k lines of dead code in the
> >> > kernel due to this.  So far we've fixed several areas, like tty,
> >> > x86, net, etc. and we continue to work on other areas.
> >> >
> >> > There are several reasons to not use module_init for code that can
> >> > never be built as a module, but the big ones are:
> >> >
> >> >  (1) it is easy to accidentally code up 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.
> >> >
> >> > Here we convert some module_init() calls into device_initcall() and delete
> >> > any module_exit and remove code that gets orphaned in the process, for
> >> > an overall net code reduction, which is always welcome.
> >> >
> >> > The use of device_initcall ensures that the init function ordering
> >> > remains unchanged, but one could argue that PCI host code might be more
> >> > appropriate to be handled under subsys_initcall.  Fortunately we can
> >> > revisit making this extra change at a later date if desired; it does
> >> > not need to happen now, and we reduce the risk of introducing
> >> > regressions at this point in time by separating the two changes.
> >> >
> >> > Over half of the drivers changed here already explicitly disallowed any
> >> > unbind operations.  For the rest we make them the same, since there is
> >> > not really any sensible use case to unbind any built-in bus support that
> >> > I can think of.
> >>
> >> Personally, I think all of these should become tristate, so distro kernels
> >> don't have to build in PCI(e) support for all SoCs. multi_v7_defconfig kernels
> >> are becoming too big.
> >>
> >> That does not preclude making these modules un-unloadable, though.
> >
> > Most of these can't be made tristate as-is, because they use symbols
> > that aren't exported. Many of those symbols can easily be exported, so
> > its just a matter of getting the respective patches merged. I disagree
> > with making the modules non-unloadable, though. I have a local branch
> > with changes necessary to unload the host controller driver and it
> > works just fine.
> >
> PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> Fixup region is in kernel region and this region if not updated when
> loading a module.

Interesting, I hadn't thought about that. I suppose this means that the
module will end up containing an unused section with the fixup code. It
might be useful to add a way for that to trigger a warning at build
time.

Perhaps to fix this a mechanism could be introduced to add a table of
fixups to a host controller driver and that will get applied to all
children of the bridge. It could be problematic to cover all of the
different fixup stages, though.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151214/46147b8a/attachment-0001.sig>

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
  2015-12-14  9:19         ` Thierry Reding
  (?)
  (?)
@ 2015-12-14 10:27           ` Arnd Bergmann
  -1 siblings, 0 replies; 82+ messages in thread
From: Arnd Bergmann @ 2015-12-14 10:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > Fixup region is in kernel region and this region if not updated when
> > loading a module.
> 
> Interesting, I hadn't thought about that. I suppose this means that the
> module will end up containing an unused section with the fixup code. It
> might be useful to add a way for that to trigger a warning at build
> time.
> 
> Perhaps to fix this a mechanism could be introduced to add a table of
> fixups to a host controller driver and that will get applied to all
> children of the bridge. It could be problematic to cover all of the
> different fixup stages, though.
> 


I think a lot of the fixups shouldn't really be there in the first place,
they are about stuff that we can fix up in the probe function, or that should
be fixed up in the probe function with some appropriate core support added.

	Arnd

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14 10:27           ` Arnd Bergmann
  0 siblings, 0 replies; 82+ messages in thread
From: Arnd Bergmann @ 2015-12-14 10:27 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Ley Foon Tan, Geert Uytterhoeven, Paul Gortmaker, linux-kernel,
	Linux-sh list, linux-pci, Alexandre Courbot, Pratyush Anand,
	Michal Simek, Kishon Vijay Abraham I, Murali Karicheri,
	Sören Brinkmann, Jason Cooper, Stephen Warren, Simon Horman,
	linux-tegra, linux-omap, linux-arm-kernel, Thomas Petazzoni

On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > Fixup region is in kernel region and this region if not updated when
> > loading a module.
> 
> Interesting, I hadn't thought about that. I suppose this means that the
> module will end up containing an unused section with the fixup code. It
> might be useful to add a way for that to trigger a warning at build
> time.
> 
> Perhaps to fix this a mechanism could be introduced to add a table of
> fixups to a host controller driver and that will get applied to all
> children of the bridge. It could be problematic to cover all of the
> different fixup stages, though.
> 


I think a lot of the fixups shouldn't really be there in the first place,
they are about stuff that we can fix up in the probe function, or that should
be fixed up in the probe function with some appropriate core support added.

	Arnd

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14 10:27           ` Arnd Bergmann
  0 siblings, 0 replies; 82+ messages in thread
From: Arnd Bergmann @ 2015-12-14 10:27 UTC (permalink / raw)
  To: Thierry Reding
  Cc: Ley Foon Tan, Geert Uytterhoeven, Paul Gortmaker, linux-kernel,
	Linux-sh list, linux-pci, Alexandre Courbot, Pratyush Anand,
	Michal Simek, Kishon Vijay Abraham I, Murali Karicheri,
	Sören Brinkmann, Jason Cooper, Stephen Warren, Simon Horman,
	linux-tegra, linux-omap, linux-arm-kernel, Thomas Petazzoni,
	Richard Zhu, Rocketboard Maillist, Bjorn Helgaas, Lucas Stach

On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > Fixup region is in kernel region and this region if not updated when
> > loading a module.
> 
> Interesting, I hadn't thought about that. I suppose this means that the
> module will end up containing an unused section with the fixup code. It
> might be useful to add a way for that to trigger a warning at build
> time.
> 
> Perhaps to fix this a mechanism could be introduced to add a table of
> fixups to a host controller driver and that will get applied to all
> children of the bridge. It could be problematic to cover all of the
> different fixup stages, though.
> 


I think a lot of the fixups shouldn't really be there in the first place,
they are about stuff that we can fix up in the probe function, or that should
be fixed up in the probe function with some appropriate core support added.

	Arnd

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

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-14 10:27           ` Arnd Bergmann
  0 siblings, 0 replies; 82+ messages in thread
From: Arnd Bergmann @ 2015-12-14 10:27 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > Fixup region is in kernel region and this region if not updated when
> > loading a module.
> 
> Interesting, I hadn't thought about that. I suppose this means that the
> module will end up containing an unused section with the fixup code. It
> might be useful to add a way for that to trigger a warning at build
> time.
> 
> Perhaps to fix this a mechanism could be introduced to add a table of
> fixups to a host controller driver and that will get applied to all
> children of the bridge. It could be problematic to cover all of the
> different fixup stages, though.
> 


I think a lot of the fixups shouldn't really be there in the first place,
they are about stuff that we can fix up in the probe function, or that should
be fixed up in the probe function with some appropriate core support added.

	Arnd

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
  2015-12-14 10:27           ` Arnd Bergmann
  (?)
  (?)
@ 2015-12-15 15:16             ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-15 15:16 UTC (permalink / raw)
  To: linux-arm-kernel

[Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*] On 14/12/2015 (Mon 11:27) Arnd Bergmann wrote:

> On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > > Fixup region is in kernel region and this region if not updated when
> > > loading a module.
> > 
> > Interesting, I hadn't thought about that. I suppose this means that the
> > module will end up containing an unused section with the fixup code. It
> > might be useful to add a way for that to trigger a warning at build
> > time.
> > 
> > Perhaps to fix this a mechanism could be introduced to add a table of
> > fixups to a host controller driver and that will get applied to all
> > children of the bridge. It could be problematic to cover all of the
> > different fixup stages, though.
> > 
> 
> 
> I think a lot of the fixups shouldn't really be there in the first place,
> they are about stuff that we can fix up in the probe function, or that should
> be fixed up in the probe function with some appropriate core support added.

So, the feedback on this is a bit all over the map, leaving me unsure
what to do next.  And is the choice we make on a per board/bsp basis or
ideally across all platforms?  I see the choices as:

1) do nothing; which IMHO is least desirable as it leaves the code
misrepresenting itself as modular; one of the key issues I wanted to fix

2) use the patches I've sent ; then as they are genuinely made modular,
the person doing so essentially "patch -R" or reverts the change as
step one.  This has the advantage of solving the "we'll get to it
someday" issue if someday never comes.

3) make them all tristate;  beat it with a stick until it compiles [M]
and modposts -- leaving the fixups and functional testing to people with
the boards and low level knowledge to make it _work_ as a module.  The
downside here is the code is still kind of misrepresenting itself as
modularly functional -- a ban of unloading might mitigate that some.

Paul.
--

> 
> 	Arnd

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-15 15:16             ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-15 15:16 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Linux-sh list, linux-pci, Rocketboard Maillist, linux-tegra,
	Thierry Reding, Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Geert Uytterhoeven,
	linux-arm-kernel, Jason Cooper, Stephen Warren, Simon Horman,
	Bjorn Helgaas, linux-omap, Sören Brinkmann,
	Thomas Petazzoni

[Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*] On 14/12/2015 (Mon 11:27) Arnd Bergmann wrote:

> On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > > Fixup region is in kernel region and this region if not updated when
> > > loading a module.
> > 
> > Interesting, I hadn't thought about that. I suppose this means that the
> > module will end up containing an unused section with the fixup code. It
> > might be useful to add a way for that to trigger a warning at build
> > time.
> > 
> > Perhaps to fix this a mechanism could be introduced to add a table of
> > fixups to a host controller driver and that will get applied to all
> > children of the bridge. It could be problematic to cover all of the
> > different fixup stages, though.
> > 
> 
> 
> I think a lot of the fixups shouldn't really be there in the first place,
> they are about stuff that we can fix up in the probe function, or that should
> be fixed up in the probe function with some appropriate core support added.

So, the feedback on this is a bit all over the map, leaving me unsure
what to do next.  And is the choice we make on a per board/bsp basis or
ideally across all platforms?  I see the choices as:

1) do nothing; which IMHO is least desirable as it leaves the code
misrepresenting itself as modular; one of the key issues I wanted to fix

2) use the patches I've sent ; then as they are genuinely made modular,
the person doing so essentially "patch -R" or reverts the change as
step one.  This has the advantage of solving the "we'll get to it
someday" issue if someday never comes.

3) make them all tristate;  beat it with a stick until it compiles [M]
and modposts -- leaving the fixups and functional testing to people with
the boards and low level knowledge to make it _work_ as a module.  The
downside here is the code is still kind of misrepresenting itself as
modularly functional -- a ban of unloading might mitigate that some.

Paul.
--

> 
> 	Arnd

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-15 15:16             ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-15 15:16 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Thierry Reding, Ley Foon Tan, Geert Uytterhoeven, linux-kernel,
	Linux-sh list, linux-pci, Alexandre Courbot, Pratyush Anand,
	Michal Simek, Kishon Vijay Abraham I, Murali Karicheri,
	Sören Brinkmann, Jason Cooper, Stephen Warren, Simon Horman,
	linux-tegra, linux-omap, linux-arm-kernel, Thomas Petazzoni,
	Richard Zhu, Rocketboard Maillist, Bjorn Helgaas, Lucas Stach

[Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*] On 14/12/2015 (Mon 11:27) Arnd Bergmann wrote:

> On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > > Fixup region is in kernel region and this region if not updated when
> > > loading a module.
> > 
> > Interesting, I hadn't thought about that. I suppose this means that the
> > module will end up containing an unused section with the fixup code. It
> > might be useful to add a way for that to trigger a warning at build
> > time.
> > 
> > Perhaps to fix this a mechanism could be introduced to add a table of
> > fixups to a host controller driver and that will get applied to all
> > children of the bridge. It could be problematic to cover all of the
> > different fixup stages, though.
> > 
> 
> 
> I think a lot of the fixups shouldn't really be there in the first place,
> they are about stuff that we can fix up in the probe function, or that should
> be fixed up in the probe function with some appropriate core support added.

So, the feedback on this is a bit all over the map, leaving me unsure
what to do next.  And is the choice we make on a per board/bsp basis or
ideally across all platforms?  I see the choices as:

1) do nothing; which IMHO is least desirable as it leaves the code
misrepresenting itself as modular; one of the key issues I wanted to fix

2) use the patches I've sent ; then as they are genuinely made modular,
the person doing so essentially "patch -R" or reverts the change as
step one.  This has the advantage of solving the "we'll get to it
someday" issue if someday never comes.

3) make them all tristate;  beat it with a stick until it compiles [M]
and modposts -- leaving the fixups and functional testing to people with
the boards and low level knowledge to make it _work_ as a module.  The
downside here is the code is still kind of misrepresenting itself as
modularly functional -- a ban of unloading might mitigate that some.

Paul.
--

> 
> 	Arnd

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

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2015-12-15 15:16             ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-15 15:16 UTC (permalink / raw)
  To: linux-arm-kernel

[Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*] On 14/12/2015 (Mon 11:27) Arnd Bergmann wrote:

> On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > > Fixup region is in kernel region and this region if not updated when
> > > loading a module.
> > 
> > Interesting, I hadn't thought about that. I suppose this means that the
> > module will end up containing an unused section with the fixup code. It
> > might be useful to add a way for that to trigger a warning at build
> > time.
> > 
> > Perhaps to fix this a mechanism could be introduced to add a table of
> > fixups to a host controller driver and that will get applied to all
> > children of the bridge. It could be problematic to cover all of the
> > different fixup stages, though.
> > 
> 
> 
> I think a lot of the fixups shouldn't really be there in the first place,
> they are about stuff that we can fix up in the probe function, or that should
> be fixed up in the probe function with some appropriate core support added.

So, the feedback on this is a bit all over the map, leaving me unsure
what to do next.  And is the choice we make on a per board/bsp basis or
ideally across all platforms?  I see the choices as:

1) do nothing; which IMHO is least desirable as it leaves the code
misrepresenting itself as modular; one of the key issues I wanted to fix

2) use the patches I've sent ; then as they are genuinely made modular,
the person doing so essentially "patch -R" or reverts the change as
step one.  This has the advantage of solving the "we'll get to it
someday" issue if someday never comes.

3) make them all tristate;  beat it with a stick until it compiles [M]
and modposts -- leaving the fixups and functional testing to people with
the boards and low level knowledge to make it _work_ as a module.  The
downside here is the code is still kind of misrepresenting itself as
modularly functional -- a ban of unloading might mitigate that some.

Paul.
--

> 
> 	Arnd

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

* RE: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
  2015-12-13 10:58     ` Geert Uytterhoeven
  (?)
@ 2015-12-17 11:32       ` Phil Edworthy
  -1 siblings, 0 replies; 82+ messages in thread
From: Phil Edworthy @ 2015-12-17 11:32 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Simon Horman, Bjorn Helgaas, linux-pci,
	Linux-sh list, Geert Uytterhoeven

SGkgUGF1bCwNCg0KT24gMTMgRGVjZW1iZXIgMjAxNSAxMDo1OSwgR2VlcnQgVXl0dGVyaG9ldmVu
IHdyb3RlOg0KPiANCj4gQ0MgTU9EVUxFX0FVVEhPUg0KPiANCj4gT24gU3VuLCBEZWMgMTMsIDIw
MTUgYXQgMjo0MSBBTSwgUGF1bCBHb3J0bWFrZXINCj4gPHBhdWwuZ29ydG1ha2VyQHdpbmRyaXZl
ci5jb20+IHdyb3RlOg0KPiA+IFRoZSBLY29uZmlnIGN1cnJlbnRseSBjb250cm9sbGluZyBjb21w
aWxhdGlvbiBvZiB0aGlzIGNvZGUgaXM6DQo+ID4NCj4gPiBkcml2ZXJzL3BjaS9ob3N0L0tjb25m
aWc6Y29uZmlnIFBDSV9SQ0FSX0dFTjJfUENJRQ0KPiA+IGRyaXZlcnMvcGNpL2hvc3QvS2NvbmZp
ZzogICAgICAgYm9vbCAiUmVuZXNhcyBSLUNhciBQQ0llIGNvbnRyb2xsZXIiDQo+ID4NCj4gPiAu
Li5tZWFuaW5nIHRoYXQgaXQgY3VycmVudGx5IGlzIG5vdCBiZWluZyBidWlsdCBhcyBhIG1vZHVs
ZSBieSBhbnlvbmUuDQo+ID4NCj4gPiBMZXRzIHJlbW92ZSB0aGUgbW9kdWxhciBjb2RlIHRoYXQg
aXMgZXNzZW50aWFsbHkgb3JwaGFuZWQsIHNvIHRoYXQNCj4gPiB3aGVuIHJlYWRpbmcgdGhlIGRy
aXZlciB0aGVyZSBpcyBubyBkb3VidCBpdCBpcyBidWlsdGluLW9ubHkuDQo+ID4NCj4gPiBTaW5j
ZSBtb2R1bGVfcGxhdGZvcm1fZHJpdmVyKCkgdXNlcyB0aGUgc2FtZSBpbml0IGxldmVsIHByaW9y
aXR5IGFzDQo+ID4gYnVpbHRpbl9wbGF0Zm9ybV9kcml2ZXIoKSB0aGUgaW5pdCBvcmRlcmluZyBy
ZW1haW5zIHVuY2hhbmdlZCB3aXRoDQo+ID4gdGhpcyBjb21taXQuDQo+ID4NCj4gPiBXZSBkb24n
dCBoYXZlIHRvIGRpc2FsbG93IGEgZHJpdmVyIHVuYmluZCwgc2luY2UgdGhhdCBpcyBhbHJlYWR5
DQo+ID4gZG9uZSBmb3IgdXMgaW4gdGhpcyBkcml2ZXIuDQo+ID4NCj4gPiBBbHNvIG5vdGUgdGhh
dCBNT0RVTEVfREVWSUNFX1RBQkxFIGlzIGEgbm8tb3AgZm9yIG5vbi1tb2R1bGFyIGNvZGUuDQo+
ID4NCj4gPiBXZSBhbHNvIGRlbGV0ZSB0aGUgTU9EVUxFX0xJQ0VOU0UgdGFnIGV0Yy4gc2luY2Ug
YWxsIHRoYXQgaW5mb3JtYXRpb24NCj4gPiB3YXMgKG9yIGlzIG5vdykgY29udGFpbmVkIGF0IHRo
ZSB0b3Agb2YgdGhlIGZpbGUgaW4gdGhlIGNvbW1lbnRzLg0KPiA+DQo+ID4gQ2M6IFNpbW9uIEhv
cm1hbiA8aG9ybXNAdmVyZ2UubmV0LmF1Pg0KPiA+IENjOiBCam9ybiBIZWxnYWFzIDxiaGVsZ2Fh
c0Bnb29nbGUuY29tPg0KPiA+IENjOiBsaW51eC1wY2lAdmdlci5rZXJuZWwub3JnDQo+ID4gQ2M6
IGxpbnV4LXNoQHZnZXIua2VybmVsLm9yZw0KPiA+IFNpZ25lZC1vZmYtYnk6IFBhdWwgR29ydG1h
a2VyIDxwYXVsLmdvcnRtYWtlckB3aW5kcml2ZXIuY29tPg0KDQpJdCBkb2Vzbid0IGFwcGx5LCB3
b3VsZCB5b3UgbWluZCByZWJhc2luZyBvbnRvOg0KaHR0cHM6Ly9naXQua2VybmVsLm9yZy9jZ2l0
L2xpbnV4L2tlcm5lbC9naXQvaGVsZ2Fhcy9wY2kuZ2l0L2xvZy8/aD1uZXh0DQoNCkFzIGZvciB0
aGUgY2hhbmdlcyB0aGVtc2VsdmVzLA0KQWNrZWQtYnk6IFBoaWwgRWR3b3J0aHkgPHBoaWwuZWR3
b3J0aHlAcmVuZXNhcy5jb20+DQoNClRoYW5rcw0KUGhpbA0KDQo+ID4gLS0tDQo+ID4gIGRyaXZl
cnMvcGNpL2hvc3QvcGNpZS1yY2FyLmMgfCAxMSArKysrLS0tLS0tLQ0KPiA+ICAxIGZpbGUgY2hh
bmdlZCwgNCBpbnNlcnRpb25zKCspLCA3IGRlbGV0aW9ucygtKQ0KPiA+DQo+ID4gZGlmZiAtLWdp
dCBhL2RyaXZlcnMvcGNpL2hvc3QvcGNpZS1yY2FyLmMgYi9kcml2ZXJzL3BjaS9ob3N0L3BjaWUt
cmNhci5jDQo+ID4gaW5kZXggZjRmYTZjNTM3NDQ4Li4yYzYxOTI3N2QyNjUgMTAwNjQ0DQo+ID4g
LS0tIGEvZHJpdmVycy9wY2kvaG9zdC9wY2llLXJjYXIuYw0KPiA+ICsrKyBiL2RyaXZlcnMvcGNp
L2hvc3QvcGNpZS1yY2FyLmMNCj4gPiBAQCAtNyw2ICs3LDggQEANCj4gPiAgICogIGFyY2gvc2gv
ZHJpdmVycy9wY2kvb3BzLXNoNzc4Ni5jDQo+ID4gICAqICBDb3B5cmlnaHQgKEMpIDIwMDkgLSAy
MDExICBQYXVsIE11bmR0DQo+ID4gICAqDQo+ID4gKyAqIE1vZHVsZSBBdXRob3I6IFBoaWwgRWR3
b3J0aHkgPHBoaWwuZWR3b3J0aHlAcmVuZXNhcy5jb20+DQo+ID4gKyAqDQo+ID4gICAqIFRoaXMg
ZmlsZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1Ymxp
Yw0KPiA+ICAgKiBMaWNlbnNlIHZlcnNpb24gMi4gIFRoaXMgcHJvZ3JhbSBpcyBsaWNlbnNlZCAi
YXMgaXMiIHdpdGhvdXQgYW55DQo+ID4gICAqIHdhcnJhbnR5IG9mIGFueSBraW5kLCB3aGV0aGVy
IGV4cHJlc3Mgb3IgaW1wbGllZC4NCj4gPiBAQCAtMTgsNyArMjAsNyBAQA0KPiA+ICAjaW5jbHVk
ZSA8bGludXgvaXJxLmg+DQo+ID4gICNpbmNsdWRlIDxsaW51eC9pcnFkb21haW4uaD4NCj4gPiAg
I2luY2x1ZGUgPGxpbnV4L2tlcm5lbC5oPg0KPiA+IC0jaW5jbHVkZSA8bGludXgvbW9kdWxlLmg+
DQo+ID4gKyNpbmNsdWRlIDxsaW51eC9pbml0Lmg+DQo+ID4gICNpbmNsdWRlIDxsaW51eC9tc2ku
aD4NCj4gPiAgI2luY2x1ZGUgPGxpbnV4L29mX2FkZHJlc3MuaD4NCj4gPiAgI2luY2x1ZGUgPGxp
bnV4L29mX2lycS5oPg0KPiA+IEBAIC05MjEsNyArOTIzLDYgQEAgc3RhdGljIGNvbnN0IHN0cnVj
dCBvZl9kZXZpY2VfaWQgcmNhcl9wY2llX29mX21hdGNoW10gPSB7DQo+ID4gICAgICAgICB7IC5j
b21wYXRpYmxlID0gInJlbmVzYXMscGNpZS1yOGE3NzkxIiwgLmRhdGEgPSByY2FyX3BjaWVfaHdf
aW5pdCB9LA0KPiA+ICAgICAgICAge30sDQo+ID4gIH07DQo+ID4gLU1PRFVMRV9ERVZJQ0VfVEFC
TEUob2YsIHJjYXJfcGNpZV9vZl9tYXRjaCk7DQo+ID4NCj4gPiAgc3RhdGljIGludCByY2FyX3Bj
aWVfcHJvYmUoc3RydWN0IHBsYXRmb3JtX2RldmljZSAqcGRldikNCj4gPiAgew0KPiA+IEBAIC0x
MDA3LDggKzEwMDgsNCBAQCBzdGF0aWMgc3RydWN0IHBsYXRmb3JtX2RyaXZlciByY2FyX3BjaWVf
ZHJpdmVyID0gew0KPiA+ICAgICAgICAgfSwNCj4gPiAgICAgICAgIC5wcm9iZSA9IHJjYXJfcGNp
ZV9wcm9iZSwNCj4gPiAgfTsNCj4gPiAtbW9kdWxlX3BsYXRmb3JtX2RyaXZlcihyY2FyX3BjaWVf
ZHJpdmVyKTsNCj4gPiAtDQo+ID4gLU1PRFVMRV9BVVRIT1IoIlBoaWwgRWR3b3J0aHkgPHBoaWwu
ZWR3b3J0aHlAcmVuZXNhcy5jb20+Iik7DQo+ID4gLU1PRFVMRV9ERVNDUklQVElPTigiUmVuZXNh
cyBSLUNhciBQQ0llIGRyaXZlciIpOw0KPiA+IC1NT0RVTEVfTElDRU5TRSgiR1BMIHYyIik7DQo+
ID4gK2J1aWx0aW5fcGxhdGZvcm1fZHJpdmVyKHJjYXJfcGNpZV9kcml2ZXIpOw0KPiANCj4gR3J7
b2V0amUsZWV0aW5nfXMsDQo+IA0KPiAgICAgICAgICAgICAgICAgICAgICAgICBHZWVydA0KPiAN
Cj4gLS0NCj4gR2VlcnQgVXl0dGVyaG9ldmVuIC0tIFRoZXJlJ3MgbG90cyBvZiBMaW51eCBiZXlv
bmQgaWEzMiAtLSBnZWVydEBsaW51eC1tNjhrLm9yZw0KPiANCj4gSW4gcGVyc29uYWwgY29udmVy
c2F0aW9ucyB3aXRoIHRlY2huaWNhbCBwZW9wbGUsIEkgY2FsbCBteXNlbGYgYSBoYWNrZXIuIEJ1
dA0KPiB3aGVuIEknbSB0YWxraW5nIHRvIGpvdXJuYWxpc3RzIEkganVzdCBzYXkgInByb2dyYW1t
ZXIiIG9yIHNvbWV0aGluZyBsaWtlIHRoYXQuDQo+ICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgLS0gTGludXMgVG9ydmFsZHMNCg=

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

* RE: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
@ 2015-12-17 11:32       ` Phil Edworthy
  0 siblings, 0 replies; 82+ messages in thread
From: Phil Edworthy @ 2015-12-17 11:32 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Simon Horman, Bjorn Helgaas, linux-pci,
	Linux-sh list, Geert Uytterhoeven

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3733 bytes --]

Hi Paul,

On 13 December 2015 10:59, Geert Uytterhoeven wrote:
> 
> CC MODULE_AUTHOR
> 
> On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> <paul.gortmaker@windriver.com> wrote:
> > The Kconfig currently controlling compilation of this code is:
> >
> > drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
> > drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"
> >
> > ...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.
> >
> > We don't have to disallow a driver unbind, since that is already
> > done for us in this driver.
> >
> > 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: Simon Horman <horms@verge.net.au>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: linux-pci@vger.kernel.org
> > Cc: linux-sh@vger.kernel.org
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

It doesn't apply, would you mind rebasing onto:
https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=next

As for the changes themselves,
Acked-by: Phil Edworthy <phil.edworthy@renesas.com>

Thanks
Phil

> > ---
> >  drivers/pci/host/pcie-rcar.c | 11 ++++-------
> >  1 file changed, 4 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> > index f4fa6c537448..2c619277d265 100644
> > --- a/drivers/pci/host/pcie-rcar.c
> > +++ b/drivers/pci/host/pcie-rcar.c
> > @@ -7,6 +7,8 @@
> >   *  arch/sh/drivers/pci/ops-sh7786.c
> >   *  Copyright (C) 2009 - 2011  Paul Mundt
> >   *
> > + * Module Author: Phil Edworthy <phil.edworthy@renesas.com>
> > + *
> >   * This file is licensed under the terms of the GNU General Public
> >   * License version 2.  This program is licensed "as is" without any
> >   * warranty of any kind, whether express or implied.
> > @@ -18,7 +20,7 @@
> >  #include <linux/irq.h>
> >  #include <linux/irqdomain.h>
> >  #include <linux/kernel.h>
> > -#include <linux/module.h>
> > +#include <linux/init.h>
> >  #include <linux/msi.h>
> >  #include <linux/of_address.h>
> >  #include <linux/of_irq.h>
> > @@ -921,7 +923,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
> >         { .compatible = "renesas,pcie-r8a7791", .data = rcar_pcie_hw_init },
> >         {},
> >  };
> > -MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
> >
> >  static int rcar_pcie_probe(struct platform_device *pdev)
> >  {
> > @@ -1007,8 +1008,4 @@ static struct platform_driver rcar_pcie_driver = {
> >         },
> >         .probe = rcar_pcie_probe,
> >  };
> > -module_platform_driver(rcar_pcie_driver);
> > -
> > -MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>");
> > -MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
> > -MODULE_LICENSE("GPL v2");
> > +builtin_platform_driver(rcar_pcie_driver);
> 
> 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
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* RE: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
@ 2015-12-17 11:32       ` Phil Edworthy
  0 siblings, 0 replies; 82+ messages in thread
From: Phil Edworthy @ 2015-12-17 11:32 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: linux-kernel, Simon Horman, Bjorn Helgaas, linux-pci,
	Linux-sh list, Geert Uytterhoeven

SGkgUGF1bCwNCg0KT24gMTMgRGVjZW1iZXIgMjAxNSAxMDo1OSwgR2VlcnQgVXl0dGVyaG9ldmVu
IHdyb3RlOg0KPiANCj4gQ0MgTU9EVUxFX0FVVEhPUg0KPiANCj4gT24gU3VuLCBEZWMgMTMsIDIw
MTUgYXQgMjo0MSBBTSwgUGF1bCBHb3J0bWFrZXINCj4gPHBhdWwuZ29ydG1ha2VyQHdpbmRyaXZl
ci5jb20+IHdyb3RlOg0KPiA+IFRoZSBLY29uZmlnIGN1cnJlbnRseSBjb250cm9sbGluZyBjb21w
aWxhdGlvbiBvZiB0aGlzIGNvZGUgaXM6DQo+ID4NCj4gPiBkcml2ZXJzL3BjaS9ob3N0L0tjb25m
aWc6Y29uZmlnIFBDSV9SQ0FSX0dFTjJfUENJRQ0KPiA+IGRyaXZlcnMvcGNpL2hvc3QvS2NvbmZp
ZzogICAgICAgYm9vbCAiUmVuZXNhcyBSLUNhciBQQ0llIGNvbnRyb2xsZXIiDQo+ID4NCj4gPiAu
Li5tZWFuaW5nIHRoYXQgaXQgY3VycmVudGx5IGlzIG5vdCBiZWluZyBidWlsdCBhcyBhIG1vZHVs
ZSBieSBhbnlvbmUuDQo+ID4NCj4gPiBMZXRzIHJlbW92ZSB0aGUgbW9kdWxhciBjb2RlIHRoYXQg
aXMgZXNzZW50aWFsbHkgb3JwaGFuZWQsIHNvIHRoYXQNCj4gPiB3aGVuIHJlYWRpbmcgdGhlIGRy
aXZlciB0aGVyZSBpcyBubyBkb3VidCBpdCBpcyBidWlsdGluLW9ubHkuDQo+ID4NCj4gPiBTaW5j
ZSBtb2R1bGVfcGxhdGZvcm1fZHJpdmVyKCkgdXNlcyB0aGUgc2FtZSBpbml0IGxldmVsIHByaW9y
aXR5IGFzDQo+ID4gYnVpbHRpbl9wbGF0Zm9ybV9kcml2ZXIoKSB0aGUgaW5pdCBvcmRlcmluZyBy
ZW1haW5zIHVuY2hhbmdlZCB3aXRoDQo+ID4gdGhpcyBjb21taXQuDQo+ID4NCj4gPiBXZSBkb24n
dCBoYXZlIHRvIGRpc2FsbG93IGEgZHJpdmVyIHVuYmluZCwgc2luY2UgdGhhdCBpcyBhbHJlYWR5
DQo+ID4gZG9uZSBmb3IgdXMgaW4gdGhpcyBkcml2ZXIuDQo+ID4NCj4gPiBBbHNvIG5vdGUgdGhh
dCBNT0RVTEVfREVWSUNFX1RBQkxFIGlzIGEgbm8tb3AgZm9yIG5vbi1tb2R1bGFyIGNvZGUuDQo+
ID4NCj4gPiBXZSBhbHNvIGRlbGV0ZSB0aGUgTU9EVUxFX0xJQ0VOU0UgdGFnIGV0Yy4gc2luY2Ug
YWxsIHRoYXQgaW5mb3JtYXRpb24NCj4gPiB3YXMgKG9yIGlzIG5vdykgY29udGFpbmVkIGF0IHRo
ZSB0b3Agb2YgdGhlIGZpbGUgaW4gdGhlIGNvbW1lbnRzLg0KPiA+DQo+ID4gQ2M6IFNpbW9uIEhv
cm1hbiA8aG9ybXNAdmVyZ2UubmV0LmF1Pg0KPiA+IENjOiBCam9ybiBIZWxnYWFzIDxiaGVsZ2Fh
c0Bnb29nbGUuY29tPg0KPiA+IENjOiBsaW51eC1wY2lAdmdlci5rZXJuZWwub3JnDQo+ID4gQ2M6
IGxpbnV4LXNoQHZnZXIua2VybmVsLm9yZw0KPiA+IFNpZ25lZC1vZmYtYnk6IFBhdWwgR29ydG1h
a2VyIDxwYXVsLmdvcnRtYWtlckB3aW5kcml2ZXIuY29tPg0KDQpJdCBkb2Vzbid0IGFwcGx5LCB3
b3VsZCB5b3UgbWluZCByZWJhc2luZyBvbnRvOg0KaHR0cHM6Ly9naXQua2VybmVsLm9yZy9jZ2l0
L2xpbnV4L2tlcm5lbC9naXQvaGVsZ2Fhcy9wY2kuZ2l0L2xvZy8/aD1uZXh0DQoNCkFzIGZvciB0
aGUgY2hhbmdlcyB0aGVtc2VsdmVzLA0KQWNrZWQtYnk6IFBoaWwgRWR3b3J0aHkgPHBoaWwuZWR3
b3J0aHlAcmVuZXNhcy5jb20+DQoNClRoYW5rcw0KUGhpbA0KDQo+ID4gLS0tDQo+ID4gIGRyaXZl
cnMvcGNpL2hvc3QvcGNpZS1yY2FyLmMgfCAxMSArKysrLS0tLS0tLQ0KPiA+ICAxIGZpbGUgY2hh
bmdlZCwgNCBpbnNlcnRpb25zKCspLCA3IGRlbGV0aW9ucygtKQ0KPiA+DQo+ID4gZGlmZiAtLWdp
dCBhL2RyaXZlcnMvcGNpL2hvc3QvcGNpZS1yY2FyLmMgYi9kcml2ZXJzL3BjaS9ob3N0L3BjaWUt
cmNhci5jDQo+ID4gaW5kZXggZjRmYTZjNTM3NDQ4Li4yYzYxOTI3N2QyNjUgMTAwNjQ0DQo+ID4g
LS0tIGEvZHJpdmVycy9wY2kvaG9zdC9wY2llLXJjYXIuYw0KPiA+ICsrKyBiL2RyaXZlcnMvcGNp
L2hvc3QvcGNpZS1yY2FyLmMNCj4gPiBAQCAtNyw2ICs3LDggQEANCj4gPiAgICogIGFyY2gvc2gv
ZHJpdmVycy9wY2kvb3BzLXNoNzc4Ni5jDQo+ID4gICAqICBDb3B5cmlnaHQgKEMpIDIwMDkgLSAy
MDExICBQYXVsIE11bmR0DQo+ID4gICAqDQo+ID4gKyAqIE1vZHVsZSBBdXRob3I6IFBoaWwgRWR3
b3J0aHkgPHBoaWwuZWR3b3J0aHlAcmVuZXNhcy5jb20+DQo+ID4gKyAqDQo+ID4gICAqIFRoaXMg
ZmlsZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgdGVybXMgb2YgdGhlIEdOVSBHZW5lcmFsIFB1Ymxp
Yw0KPiA+ICAgKiBMaWNlbnNlIHZlcnNpb24gMi4gIFRoaXMgcHJvZ3JhbSBpcyBsaWNlbnNlZCAi
YXMgaXMiIHdpdGhvdXQgYW55DQo+ID4gICAqIHdhcnJhbnR5IG9mIGFueSBraW5kLCB3aGV0aGVy
IGV4cHJlc3Mgb3IgaW1wbGllZC4NCj4gPiBAQCAtMTgsNyArMjAsNyBAQA0KPiA+ICAjaW5jbHVk
ZSA8bGludXgvaXJxLmg+DQo+ID4gICNpbmNsdWRlIDxsaW51eC9pcnFkb21haW4uaD4NCj4gPiAg
I2luY2x1ZGUgPGxpbnV4L2tlcm5lbC5oPg0KPiA+IC0jaW5jbHVkZSA8bGludXgvbW9kdWxlLmg+
DQo+ID4gKyNpbmNsdWRlIDxsaW51eC9pbml0Lmg+DQo+ID4gICNpbmNsdWRlIDxsaW51eC9tc2ku
aD4NCj4gPiAgI2luY2x1ZGUgPGxpbnV4L29mX2FkZHJlc3MuaD4NCj4gPiAgI2luY2x1ZGUgPGxp
bnV4L29mX2lycS5oPg0KPiA+IEBAIC05MjEsNyArOTIzLDYgQEAgc3RhdGljIGNvbnN0IHN0cnVj
dCBvZl9kZXZpY2VfaWQgcmNhcl9wY2llX29mX21hdGNoW10gPSB7DQo+ID4gICAgICAgICB7IC5j
b21wYXRpYmxlID0gInJlbmVzYXMscGNpZS1yOGE3NzkxIiwgLmRhdGEgPSByY2FyX3BjaWVfaHdf
aW5pdCB9LA0KPiA+ICAgICAgICAge30sDQo+ID4gIH07DQo+ID4gLU1PRFVMRV9ERVZJQ0VfVEFC
TEUob2YsIHJjYXJfcGNpZV9vZl9tYXRjaCk7DQo+ID4NCj4gPiAgc3RhdGljIGludCByY2FyX3Bj
aWVfcHJvYmUoc3RydWN0IHBsYXRmb3JtX2RldmljZSAqcGRldikNCj4gPiAgew0KPiA+IEBAIC0x
MDA3LDggKzEwMDgsNCBAQCBzdGF0aWMgc3RydWN0IHBsYXRmb3JtX2RyaXZlciByY2FyX3BjaWVf
ZHJpdmVyID0gew0KPiA+ICAgICAgICAgfSwNCj4gPiAgICAgICAgIC5wcm9iZSA9IHJjYXJfcGNp
ZV9wcm9iZSwNCj4gPiAgfTsNCj4gPiAtbW9kdWxlX3BsYXRmb3JtX2RyaXZlcihyY2FyX3BjaWVf
ZHJpdmVyKTsNCj4gPiAtDQo+ID4gLU1PRFVMRV9BVVRIT1IoIlBoaWwgRWR3b3J0aHkgPHBoaWwu
ZWR3b3J0aHlAcmVuZXNhcy5jb20+Iik7DQo+ID4gLU1PRFVMRV9ERVNDUklQVElPTigiUmVuZXNh
cyBSLUNhciBQQ0llIGRyaXZlciIpOw0KPiA+IC1NT0RVTEVfTElDRU5TRSgiR1BMIHYyIik7DQo+
ID4gK2J1aWx0aW5fcGxhdGZvcm1fZHJpdmVyKHJjYXJfcGNpZV9kcml2ZXIpOw0KPiANCj4gR3J7
b2V0amUsZWV0aW5nfXMsDQo+IA0KPiAgICAgICAgICAgICAgICAgICAgICAgICBHZWVydA0KPiAN
Cj4gLS0NCj4gR2VlcnQgVXl0dGVyaG9ldmVuIC0tIFRoZXJlJ3MgbG90cyBvZiBMaW51eCBiZXlv
bmQgaWEzMiAtLSBnZWVydEBsaW51eC1tNjhrLm9yZw0KPiANCj4gSW4gcGVyc29uYWwgY29udmVy
c2F0aW9ucyB3aXRoIHRlY2huaWNhbCBwZW9wbGUsIEkgY2FsbCBteXNlbGYgYSBoYWNrZXIuIEJ1
dA0KPiB3aGVuIEknbSB0YWxraW5nIHRvIGpvdXJuYWxpc3RzIEkganVzdCBzYXkgInByb2dyYW1t
ZXIiIG9yIHNvbWV0aGluZyBsaWtlIHRoYXQuDQo+ICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgLS0gTGludXMgVG9ydmFsZHMNCg==

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

* Re: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
  2015-12-17 11:32       ` Phil Edworthy
@ 2015-12-17 16:06         ` Paul Gortmaker
  -1 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-17 16:06 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: linux-kernel, Simon Horman, Bjorn Helgaas, linux-pci,
	Linux-sh list, Geert Uytterhoeven

[RE: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular] On 17/12/2015 (Thu 11:32) Phil Edworthy wrote:

> Hi Paul,
> 
> On 13 December 2015 10:59, Geert Uytterhoeven wrote:
> > 
> > CC MODULE_AUTHOR
> > 
> > On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> > <paul.gortmaker@windriver.com> wrote:
> > > The Kconfig currently controlling compilation of this code is:
> > >
> > > drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
> > > drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"
> > >
> > > ...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.
> > >
> > > We don't have to disallow a driver unbind, since that is already
> > > done for us in this driver.
> > >
> > > 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: Simon Horman <horms@verge.net.au>
> > > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > > Cc: linux-pci@vger.kernel.org
> > > Cc: linux-sh@vger.kernel.org
> > > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> It doesn't apply, would you mind rebasing onto:
> https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=next
> 

Sure I can do that and just resend the 2 renesas commits if there is no
interest in tristate conversions for them.  As for the others, I'm still
awaiting feedback on what approach people want to take;  I listed what I
figured our possible options are.

Paul.
--

> As for the changes themselves,
> Acked-by: Phil Edworthy <phil.edworthy@renesas.com>
> 
> Thanks
> Phil
> 
> > > ---
> > >  drivers/pci/host/pcie-rcar.c | 11 ++++-------
> > >  1 file changed, 4 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> > > index f4fa6c537448..2c619277d265 100644
> > > --- a/drivers/pci/host/pcie-rcar.c
> > > +++ b/drivers/pci/host/pcie-rcar.c
> > > @@ -7,6 +7,8 @@
> > >   *  arch/sh/drivers/pci/ops-sh7786.c
> > >   *  Copyright (C) 2009 - 2011  Paul Mundt
> > >   *
> > > + * Module Author: Phil Edworthy <phil.edworthy@renesas.com>
> > > + *
> > >   * This file is licensed under the terms of the GNU General Public
> > >   * License version 2.  This program is licensed "as is" without any
> > >   * warranty of any kind, whether express or implied.
> > > @@ -18,7 +20,7 @@
> > >  #include <linux/irq.h>
> > >  #include <linux/irqdomain.h>
> > >  #include <linux/kernel.h>
> > > -#include <linux/module.h>
> > > +#include <linux/init.h>
> > >  #include <linux/msi.h>
> > >  #include <linux/of_address.h>
> > >  #include <linux/of_irq.h>
> > > @@ -921,7 +923,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
> > >         { .compatible = "renesas,pcie-r8a7791", .data = rcar_pcie_hw_init },
> > >         {},
> > >  };
> > > -MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
> > >
> > >  static int rcar_pcie_probe(struct platform_device *pdev)
> > >  {
> > > @@ -1007,8 +1008,4 @@ static struct platform_driver rcar_pcie_driver = {
> > >         },
> > >         .probe = rcar_pcie_probe,
> > >  };
> > > -module_platform_driver(rcar_pcie_driver);
> > > -
> > > -MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>");
> > > -MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
> > > -MODULE_LICENSE("GPL v2");
> > > +builtin_platform_driver(rcar_pcie_driver);
> > 
> > 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] 82+ messages in thread

* Re: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular
@ 2015-12-17 16:06         ` Paul Gortmaker
  0 siblings, 0 replies; 82+ messages in thread
From: Paul Gortmaker @ 2015-12-17 16:06 UTC (permalink / raw)
  To: Phil Edworthy
  Cc: linux-kernel, Simon Horman, Bjorn Helgaas, linux-pci,
	Linux-sh list, Geert Uytterhoeven

[RE: [PATCH 07/10] drivers/pci: make host/pcie-rcar.c explicitly non-modular] On 17/12/2015 (Thu 11:32) Phil Edworthy wrote:

> Hi Paul,
> 
> On 13 December 2015 10:59, Geert Uytterhoeven wrote:
> > 
> > CC MODULE_AUTHOR
> > 
> > On Sun, Dec 13, 2015 at 2:41 AM, Paul Gortmaker
> > <paul.gortmaker@windriver.com> wrote:
> > > The Kconfig currently controlling compilation of this code is:
> > >
> > > drivers/pci/host/Kconfig:config PCI_RCAR_GEN2_PCIE
> > > drivers/pci/host/Kconfig:       bool "Renesas R-Car PCIe controller"
> > >
> > > ...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.
> > >
> > > We don't have to disallow a driver unbind, since that is already
> > > done for us in this driver.
> > >
> > > 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: Simon Horman <horms@verge.net.au>
> > > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > > Cc: linux-pci@vger.kernel.org
> > > Cc: linux-sh@vger.kernel.org
> > > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> It doesn't apply, would you mind rebasing onto:
> https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=next
> 

Sure I can do that and just resend the 2 renesas commits if there is no
interest in tristate conversions for them.  As for the others, I'm still
awaiting feedback on what approach people want to take;  I listed what I
figured our possible options are.

Paul.
--

> As for the changes themselves,
> Acked-by: Phil Edworthy <phil.edworthy@renesas.com>
> 
> Thanks
> Phil
> 
> > > ---
> > >  drivers/pci/host/pcie-rcar.c | 11 ++++-------
> > >  1 file changed, 4 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/drivers/pci/host/pcie-rcar.c b/drivers/pci/host/pcie-rcar.c
> > > index f4fa6c537448..2c619277d265 100644
> > > --- a/drivers/pci/host/pcie-rcar.c
> > > +++ b/drivers/pci/host/pcie-rcar.c
> > > @@ -7,6 +7,8 @@
> > >   *  arch/sh/drivers/pci/ops-sh7786.c
> > >   *  Copyright (C) 2009 - 2011  Paul Mundt
> > >   *
> > > + * Module Author: Phil Edworthy <phil.edworthy@renesas.com>
> > > + *
> > >   * This file is licensed under the terms of the GNU General Public
> > >   * License version 2.  This program is licensed "as is" without any
> > >   * warranty of any kind, whether express or implied.
> > > @@ -18,7 +20,7 @@
> > >  #include <linux/irq.h>
> > >  #include <linux/irqdomain.h>
> > >  #include <linux/kernel.h>
> > > -#include <linux/module.h>
> > > +#include <linux/init.h>
> > >  #include <linux/msi.h>
> > >  #include <linux/of_address.h>
> > >  #include <linux/of_irq.h>
> > > @@ -921,7 +923,6 @@ static const struct of_device_id rcar_pcie_of_match[] = {
> > >         { .compatible = "renesas,pcie-r8a7791", .data = rcar_pcie_hw_init },
> > >         {},
> > >  };
> > > -MODULE_DEVICE_TABLE(of, rcar_pcie_of_match);
> > >
> > >  static int rcar_pcie_probe(struct platform_device *pdev)
> > >  {
> > > @@ -1007,8 +1008,4 @@ static struct platform_driver rcar_pcie_driver = {
> > >         },
> > >         .probe = rcar_pcie_probe,
> > >  };
> > > -module_platform_driver(rcar_pcie_driver);
> > > -
> > > -MODULE_AUTHOR("Phil Edworthy <phil.edworthy@renesas.com>");
> > > -MODULE_DESCRIPTION("Renesas R-Car PCIe driver");
> > > -MODULE_LICENSE("GPL v2");
> > > +builtin_platform_driver(rcar_pcie_driver);
> > 
> > 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] 82+ messages in thread

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2016-01-08 20:31               ` Bjorn Helgaas
  0 siblings, 0 replies; 82+ messages in thread
From: Bjorn Helgaas @ 2016-01-08 20:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Dec 15, 2015 at 10:16:24AM -0500, Paul Gortmaker wrote:
> [Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*] On 14/12/2015 (Mon 11:27) Arnd Bergmann wrote:
> 
> > On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > > > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > > > Fixup region is in kernel region and this region if not updated when
> > > > loading a module.
> > > 
> > > Interesting, I hadn't thought about that. I suppose this means that the
> > > module will end up containing an unused section with the fixup code. It
> > > might be useful to add a way for that to trigger a warning at build
> > > time.
> > > 
> > > Perhaps to fix this a mechanism could be introduced to add a table of
> > > fixups to a host controller driver and that will get applied to all
> > > children of the bridge. It could be problematic to cover all of the
> > > different fixup stages, though.
> > 
> > I think a lot of the fixups shouldn't really be there in the first place,
> > they are about stuff that we can fix up in the probe function, or that should
> > be fixed up in the probe function with some appropriate core support added.
> 
> So, the feedback on this is a bit all over the map, leaving me unsure
> what to do next.  And is the choice we make on a per board/bsp basis or
> ideally across all platforms?  I see the choices as:
> 
> 1) do nothing; which IMHO is least desirable as it leaves the code
> misrepresenting itself as modular; one of the key issues I wanted to fix
> 
> 2) use the patches I've sent ; then as they are genuinely made modular,
> the person doing so essentially "patch -R" or reverts the change as
> step one.  This has the advantage of solving the "we'll get to it
> someday" issue if someday never comes.
> 
> 3) make them all tristate;  beat it with a stick until it compiles [M]
> and modposts -- leaving the fixups and functional testing to people with
> the boards and low level knowledge to make it _work_ as a module.  The
> downside here is the code is still kind of misrepresenting itself as
> modularly functional -- a ban of unloading might mitigate that some.

I'd like to preserve the mind-set that host controller drivers are
*expected* to be modular, even if we aren't there yet.  I guess that
means I'm in favor of option 3, at least for drivers that don't use
fixups.

Bjorn

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2016-01-08 20:31               ` Bjorn Helgaas
  0 siblings, 0 replies; 82+ messages in thread
From: Bjorn Helgaas @ 2016-01-08 20:31 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Arnd Bergmann, Thierry Reding, Ley Foon Tan, Geert Uytterhoeven,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Linux-sh list, linux-pci,
	Alexandre Courbot, Pratyush Anand, Michal Simek,
	Kishon Vijay Abraham I, Murali Karicheri, Sören Brinkmann,
	Jason Cooper, Stephen Warren, Simon Horman,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Thomas Petazzoni

On Tue, Dec 15, 2015 at 10:16:24AM -0500, Paul Gortmaker wrote:
> [Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*] On 14/12/2015 (Mon 11:27) Arnd Bergmann wrote:
> 
> > On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > > > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > > > Fixup region is in kernel region and this region if not updated when
> > > > loading a module.
> > > 
> > > Interesting, I hadn't thought about that. I suppose this means that the
> > > module will end up containing an unused section with the fixup code. It
> > > might be useful to add a way for that to trigger a warning at build
> > > time.
> > > 
> > > Perhaps to fix this a mechanism could be introduced to add a table of
> > > fixups to a host controller driver and that will get applied to all
> > > children of the bridge. It could be problematic to cover all of the
> > > different fixup stages, though.
> > 
> > I think a lot of the fixups shouldn't really be there in the first place,
> > they are about stuff that we can fix up in the probe function, or that should
> > be fixed up in the probe function with some appropriate core support added.
> 
> So, the feedback on this is a bit all over the map, leaving me unsure
> what to do next.  And is the choice we make on a per board/bsp basis or
> ideally across all platforms?  I see the choices as:
> 
> 1) do nothing; which IMHO is least desirable as it leaves the code
> misrepresenting itself as modular; one of the key issues I wanted to fix
> 
> 2) use the patches I've sent ; then as they are genuinely made modular,
> the person doing so essentially "patch -R" or reverts the change as
> step one.  This has the advantage of solving the "we'll get to it
> someday" issue if someday never comes.
> 
> 3) make them all tristate;  beat it with a stick until it compiles [M]
> and modposts -- leaving the fixups and functional testing to people with
> the boards and low level knowledge to make it _work_ as a module.  The
> downside here is the code is still kind of misrepresenting itself as
> modularly functional -- a ban of unloading might mitigate that some.

I'd like to preserve the mind-set that host controller drivers are
*expected* to be modular, even if we aren't there yet.  I guess that
means I'm in favor of option 3, at least for drivers that don't use
fixups.

Bjorn

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

* Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2016-01-08 20:31               ` Bjorn Helgaas
  0 siblings, 0 replies; 82+ messages in thread
From: Bjorn Helgaas @ 2016-01-08 20:31 UTC (permalink / raw)
  To: Paul Gortmaker
  Cc: Arnd Bergmann, Thierry Reding, Ley Foon Tan, Geert Uytterhoeven,
	linux-kernel, Linux-sh list, linux-pci, Alexandre Courbot,
	Pratyush Anand, Michal Simek, Kishon Vijay Abraham I,
	Murali Karicheri, Sören Brinkmann, Jason Cooper,
	Stephen Warren, Simon Horman, linux-tegra, linux-omap,
	linux-arm-kernel, Thomas Petazzoni, Richard Zhu,
	Rocketboard Maillist, Bjorn Helgaas, Lucas Stach

On Tue, Dec 15, 2015 at 10:16:24AM -0500, Paul Gortmaker wrote:
> [Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*] On 14/12/2015 (Mon 11:27) Arnd Bergmann wrote:
> 
> > On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > > > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > > > Fixup region is in kernel region and this region if not updated when
> > > > loading a module.
> > > 
> > > Interesting, I hadn't thought about that. I suppose this means that the
> > > module will end up containing an unused section with the fixup code. It
> > > might be useful to add a way for that to trigger a warning at build
> > > time.
> > > 
> > > Perhaps to fix this a mechanism could be introduced to add a table of
> > > fixups to a host controller driver and that will get applied to all
> > > children of the bridge. It could be problematic to cover all of the
> > > different fixup stages, though.
> > 
> > I think a lot of the fixups shouldn't really be there in the first place,
> > they are about stuff that we can fix up in the probe function, or that should
> > be fixed up in the probe function with some appropriate core support added.
> 
> So, the feedback on this is a bit all over the map, leaving me unsure
> what to do next.  And is the choice we make on a per board/bsp basis or
> ideally across all platforms?  I see the choices as:
> 
> 1) do nothing; which IMHO is least desirable as it leaves the code
> misrepresenting itself as modular; one of the key issues I wanted to fix
> 
> 2) use the patches I've sent ; then as they are genuinely made modular,
> the person doing so essentially "patch -R" or reverts the change as
> step one.  This has the advantage of solving the "we'll get to it
> someday" issue if someday never comes.
> 
> 3) make them all tristate;  beat it with a stick until it compiles [M]
> and modposts -- leaving the fixups and functional testing to people with
> the boards and low level knowledge to make it _work_ as a module.  The
> downside here is the code is still kind of misrepresenting itself as
> modularly functional -- a ban of unloading might mitigate that some.

I'd like to preserve the mind-set that host controller drivers are
*expected* to be modular, even if we aren't there yet.  I guess that
means I'm in favor of option 3, at least for drivers that don't use
fixups.

Bjorn

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

* [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
@ 2016-01-08 20:31               ` Bjorn Helgaas
  0 siblings, 0 replies; 82+ messages in thread
From: Bjorn Helgaas @ 2016-01-08 20:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Dec 15, 2015 at 10:16:24AM -0500, Paul Gortmaker wrote:
> [Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*] On 14/12/2015 (Mon 11:27) Arnd Bergmann wrote:
> 
> > On Monday 14 December 2015 10:19:40 Thierry Reding wrote:
> > > > PCIe host driver that use fixup (DECLARE_PCI_FIXUP_*) can't use tristate.
> > > > Fixup region is in kernel region and this region if not updated when
> > > > loading a module.
> > > 
> > > Interesting, I hadn't thought about that. I suppose this means that the
> > > module will end up containing an unused section with the fixup code. It
> > > might be useful to add a way for that to trigger a warning at build
> > > time.
> > > 
> > > Perhaps to fix this a mechanism could be introduced to add a table of
> > > fixups to a host controller driver and that will get applied to all
> > > children of the bridge. It could be problematic to cover all of the
> > > different fixup stages, though.
> > 
> > I think a lot of the fixups shouldn't really be there in the first place,
> > they are about stuff that we can fix up in the probe function, or that should
> > be fixed up in the probe function with some appropriate core support added.
> 
> So, the feedback on this is a bit all over the map, leaving me unsure
> what to do next.  And is the choice we make on a per board/bsp basis or
> ideally across all platforms?  I see the choices as:
> 
> 1) do nothing; which IMHO is least desirable as it leaves the code
> misrepresenting itself as modular; one of the key issues I wanted to fix
> 
> 2) use the patches I've sent ; then as they are genuinely made modular,
> the person doing so essentially "patch -R" or reverts the change as
> step one.  This has the advantage of solving the "we'll get to it
> someday" issue if someday never comes.
> 
> 3) make them all tristate;  beat it with a stick until it compiles [M]
> and modposts -- leaving the fixups and functional testing to people with
> the boards and low level knowledge to make it _work_ as a module.  The
> downside here is the code is still kind of misrepresenting itself as
> modularly functional -- a ban of unloading might mitigate that some.

I'd like to preserve the mind-set that host controller drivers are
*expected* to be modular, even if we aren't there yet.  I guess that
means I'm in favor of option 3, at least for drivers that don't use
fixups.

Bjorn

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

end of thread, other threads:[~2016-01-08 20:31 UTC | newest]

Thread overview: 82+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-13  1:41 [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci* Paul Gortmaker
2015-12-13  1:41 ` Paul Gortmaker
2015-12-13  1:41 ` Paul Gortmaker
2015-12-13  1:41 ` Paul Gortmaker
2015-12-13  1:41 ` [PATCH 01/10] drivers/pci: make host/pci-imx6.c driver explicitly non-modular Paul Gortmaker
2015-12-13  1:41   ` Paul Gortmaker
2015-12-14  8:52   ` Arnd Bergmann
2015-12-14  8:52     ` Arnd Bergmann
2015-12-13  1:41 ` [PATCH 02/10] drivers/pci: make host/pcie-spear13xx.c " Paul Gortmaker
2015-12-13  1:41 ` [PATCH 03/10] drivers/pci: make host/pci-mvebu.c " Paul Gortmaker
2015-12-13  1:41   ` Paul Gortmaker
2015-12-13 10:33   ` Thomas Petazzoni
2015-12-13 10:33     ` Thomas Petazzoni
2015-12-14  8:54   ` Arnd Bergmann
2015-12-14  8:54     ` Arnd Bergmann
2015-12-13  1:41 ` [PATCH 04/10] drivers/pci: make host/pci-dra7xx.c " Paul Gortmaker
2015-12-13  1:41   ` Paul Gortmaker
2015-12-13  1:41 ` [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c " Paul Gortmaker
2015-12-13  1:41   ` Paul Gortmaker
2015-12-13 10:59   ` Geert Uytterhoeven
2015-12-13 10:59     ` Geert Uytterhoeven
2015-12-13 18:15     ` Paul Gortmaker
2015-12-13 18:15       ` Paul Gortmaker
2015-12-13 20:37       ` Joe Perches
2015-12-13 20:37         ` Joe Perches
2015-12-14  5:19   ` Simon Horman
2015-12-14  5:19     ` Simon Horman
2015-12-13  1:41 ` [PATCH 06/10] drivers/pci: make host/pci-tegra.c " Paul Gortmaker
2015-12-13  1:41   ` Paul Gortmaker
2015-12-14  8:15   ` Thierry Reding
2015-12-13  1:41 ` [PATCH 07/10] drivers/pci: make host/pcie-rcar.c " Paul Gortmaker
2015-12-13  1:41   ` Paul Gortmaker
2015-12-13 10:58   ` Geert Uytterhoeven
2015-12-13 10:58     ` Geert Uytterhoeven
2015-12-13 18:20     ` Paul Gortmaker
2015-12-13 18:20       ` Paul Gortmaker
2015-12-17 11:32     ` Phil Edworthy
2015-12-17 11:32       ` Phil Edworthy
2015-12-17 11:32       ` Phil Edworthy
2015-12-17 16:06       ` Paul Gortmaker
2015-12-17 16:06         ` Paul Gortmaker
2015-12-14  5:19   ` Simon Horman
2015-12-14  5:19     ` Simon Horman
2015-12-13  1:41 ` [PATCH 08/10] drivers/pci: make host/pcie-xilinx.c " Paul Gortmaker
2015-12-13  1:41   ` Paul Gortmaker
2015-12-14  7:25   ` Michal Simek
2015-12-14  7:25     ` Michal Simek
2015-12-13  1:41 ` [PATCH 09/10] drivers/pci: make host/pci-keystone.c " Paul Gortmaker
2015-12-13  1:41   ` Paul Gortmaker
2015-12-13  1:41 ` [PATCH 10/10] drivers/pci: make host/pcie-altera.c " Paul Gortmaker
2015-12-14  8:19 ` [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci* Geert Uytterhoeven
2015-12-14  8:19   ` Geert Uytterhoeven
2015-12-14  8:19   ` Geert Uytterhoeven
2015-12-14  8:19   ` Geert Uytterhoeven
2015-12-14  8:24   ` Thierry Reding
2015-12-14  8:24     ` Thierry Reding
2015-12-14  8:24     ` Thierry Reding
2015-12-14  8:24     ` Thierry Reding
2015-12-14  8:26     ` Michal Simek
2015-12-14  8:26       ` Michal Simek
2015-12-14  8:26       ` Michal Simek
2015-12-14  8:26       ` Michal Simek
2015-12-14  8:33     ` Ley Foon Tan
2015-12-14  8:33       ` Ley Foon Tan
2015-12-14  8:33       ` Ley Foon Tan
2015-12-14  8:33       ` Ley Foon Tan
2015-12-14  9:19       ` Thierry Reding
2015-12-14  9:19         ` Thierry Reding
2015-12-14  9:19         ` Thierry Reding
2015-12-14  9:19         ` Thierry Reding
2015-12-14 10:27         ` Arnd Bergmann
2015-12-14 10:27           ` Arnd Bergmann
2015-12-14 10:27           ` Arnd Bergmann
2015-12-14 10:27           ` Arnd Bergmann
2015-12-15 15:16           ` Paul Gortmaker
2015-12-15 15:16             ` Paul Gortmaker
2015-12-15 15:16             ` Paul Gortmaker
2015-12-15 15:16             ` Paul Gortmaker
2016-01-08 20:31             ` Bjorn Helgaas
2016-01-08 20:31               ` Bjorn Helgaas
2016-01-08 20:31               ` Bjorn Helgaas
2016-01-08 20:31               ` Bjorn Helgaas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.