* [PATCH 00/14] PCI: trivial demodularization of builtin code
@ 2016-07-02 23:13 Paul Gortmaker
2016-07-02 23:13 ` [PATCH 11/14] PCI: tegra: make it explicitly non-modular Paul Gortmaker
2016-07-22 21:52 ` [PATCH 00/14] PCI: trivial demodularization of builtin code Bjorn Helgaas
0 siblings, 2 replies; 3+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 UTC (permalink / raw)
To: linux-kernel
Cc: Paul Gortmaker, Alexandre Courbot, Bjorn Helgaas, David Daney,
Gabriele Paoloni, Jason Cooper, Jesper Nilsson, Jingoo Han,
Joao Pinto, Minghuan Lian, Mingkai Hu, Murali Karicheri,
Niklas Cassel, Phil Edworthy, Pratyush Anand, Roy Zang,
Simon Horman, Stephen Warren, Tanmay Inamdar, Thierry Reding,
Thomas Petazzoni, Valentine Barshak <va>
Firstly, this group of commits was chosen for the fact that they don't
change anything even at a binary object file level ; they just replace
module_platform_driver with builtin_platform_driver, and remove some
MODULE_<blah> tags that are no-ops in code. So the regression risk
is zero here.
More specifically, we are doing the following to pci/host files that
currently can only be built-in:
-- remove the include of module.h ; replace it with init.h as req'd
-- drop instances of MODULE_DEVICE_TABLE which is a no-op built-in.
-- replace module_platform_driver with builtin_platform_driver, which
is functionally identical once CPP has processed the source.
-- drop instances of MODULE_LICENSE, MODULE_AUTHOR, MODULE_DESCRIPTION
while ensuring the contained info is present in the file comments.
After considering the inital version of demodularization PCI host
commits[1], we did consider striving for tristate[2] on another
subset of PCI host files in order to keep bzImage sizes lower on
multi-platform builds, but that proved to have technical challenges
well outside the scope of what we are trying to achieve here, given
PCI is infrastructure code and not a case of simple endpoint
drivers.
In the meantime more new code copies the existing examples of bool
Kconfig using modular references; further expanding the problem
space. So we are just going to proceed with the demodularization
as originally planned. Nothing removed here is rocket science, and
can easily be restored if someone has the hardware to test on and
the desire to expand functionality into the tristate realm.
A more complete description of why we are doing this can be found
in the original posting[1] for those that haven't seen it yet.
This represents just over 1/2 the PCI drivers that have their Kconfig
as bool but needlessly use modular references. The remainder do not
deliver exact binary equivalence, since they delete unused __exit
functions and/or unused ".remove" functions. So they are more
appropriate for submission earlier in the next development window.
Build tested for allmodconfig on several arch, including ARM and
ARM-64 on the most recent linux-next baseline.
Paul.
[1] https://lkml.kernel.org/r/1449970917-12633-1-git-send-email-paul.gortmaker@windriver.com
[2] https://lkml.kernel.org/r/1454889644-27830-1-git-send-email-paul.gortmaker@windriver.com
---
[vs v1 in [1] above, I tweaked the subjects slightly to match the
format used by most PCI commits, i.e drop the "driver/" prefix. ]
Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: David Daney <david.daney@cavium.com>
Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Joao Pinto <jpinto@synopsys.com>
Cc: Minghuan Lian <minghuan.Lian@freescale.com>
Cc: Mingkai Hu <mingkai.hu@freescale.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Niklas Cassel <niklas.cassel@axis.com>
Cc: Phil Edworthy <phil.edworthy@renesas.com>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Roy Zang <tie-fei.zang@freescale.com>
Cc: Simon Horman <horms@verge.net.au>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Tanmay Inamdar <tinamdar@apm.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Valentine Barshak <valentine.barshak@cogentembedded.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Zhou Wang <wangzhou1@hisilicon.com>
Cc: linux-pci@vger.kernel.org
Cc: linux-tegra@vger.kernel.org
Paul Gortmaker (14):
PCI: armada8k: make it explicitly non-modular
PCI: artpec6: make it explicitly non-modular
PCI: designware-plat: make it explicitly non-modular
PCI: generic: make it explicitly non-modular
PCI: hisi: make it explicitly non-modular
PCI: keystone: make it explicitly non-modular
PCI: layerscape: make it explicitly non-modular
PCI: mvebu: make it explicitly non-modular
PCI: rcar: make it explicitly non-modular
PCI: rcar-gen2: make it explicitly non-modular
PCI: tegra: make it explicitly non-modular
PCI: thunder-ecam: make it explicitly non-modular
PCI: thunder-pem: make it explicitly non-modular
PCI: xgene: make it explicitly non-modular
drivers/pci/host/pci-host-generic.c | 10 ++--------
drivers/pci/host/pci-keystone.c | 10 ++--------
drivers/pci/host/pci-layerscape.c | 10 ++--------
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/pci-thunder-ecam.c | 8 ++------
drivers/pci/host/pci-thunder-pem.c | 8 ++------
drivers/pci/host/pci-xgene.c | 8 ++------
drivers/pci/host/pcie-armada8k.c | 14 +++++---------
drivers/pci/host/pcie-artpec6.c | 10 ++--------
drivers/pci/host/pcie-designware-plat.c | 10 ++--------
drivers/pci/host/pcie-hisi.c | 13 ++-----------
drivers/pci/host/pcie-rcar.c | 11 ++++-------
14 files changed, 38 insertions(+), 108 deletions(-)
--
2.8.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 11/14] PCI: tegra: make it explicitly non-modular
2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
@ 2016-07-02 23:13 ` Paul Gortmaker
2016-07-22 21:52 ` [PATCH 00/14] PCI: trivial demodularization of builtin code Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Paul Gortmaker @ 2016-07-02 23:13 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 few trace uses of modular code and macros, so that
when reading the driver there is no doubt it is builtin-only.
Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.
Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
We also delete the MODULE_LICENSE tag etc. since all that information
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 013d5488f9f8..c9a8eb252f50 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
*
+ * 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>
@@ -2088,7 +2090,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)
{
@@ -2277,8 +2278,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.8.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 00/14] PCI: trivial demodularization of builtin code
2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
2016-07-02 23:13 ` [PATCH 11/14] PCI: tegra: make it explicitly non-modular Paul Gortmaker
@ 2016-07-22 21:52 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2016-07-22 21:52 UTC (permalink / raw)
To: Paul Gortmaker
Cc: linux-kernel, Alexandre Courbot, Bjorn Helgaas, David Daney,
Gabriele Paoloni, Jason Cooper, Jesper Nilsson, Jingoo Han,
Joao Pinto, Minghuan Lian, Mingkai Hu, Murali Karicheri,
Niklas Cassel, Phil Edworthy, Pratyush Anand, Roy Zang,
Simon Horman, Stephen Warren, Tanmay Inamdar, Thierry Reding,
Thomas Petazzoni, Valentine Barshak
On Sat, Jul 02, 2016 at 07:13:20PM -0400, Paul Gortmaker wrote:
> Firstly, this group of commits was chosen for the fact that they don't
> change anything even at a binary object file level ; they just replace
> module_platform_driver with builtin_platform_driver, and remove some
> MODULE_<blah> tags that are no-ops in code. So the regression risk
> is zero here.
>
> More specifically, we are doing the following to pci/host files that
> currently can only be built-in:
>
> -- remove the include of module.h ; replace it with init.h as req'd
>
> -- drop instances of MODULE_DEVICE_TABLE which is a no-op built-in.
>
> -- replace module_platform_driver with builtin_platform_driver, which
> is functionally identical once CPP has processed the source.
>
> -- drop instances of MODULE_LICENSE, MODULE_AUTHOR, MODULE_DESCRIPTION
> while ensuring the contained info is present in the file comments.
>
> After considering the inital version of demodularization PCI host
> commits[1], we did consider striving for tristate[2] on another
> subset of PCI host files in order to keep bzImage sizes lower on
> multi-platform builds, but that proved to have technical challenges
> well outside the scope of what we are trying to achieve here, given
> PCI is infrastructure code and not a case of simple endpoint
> drivers.
>
> In the meantime more new code copies the existing examples of bool
> Kconfig using modular references; further expanding the problem
> space. So we are just going to proceed with the demodularization
> as originally planned. Nothing removed here is rocket science, and
> can easily be restored if someone has the hardware to test on and
> the desire to expand functionality into the tristate realm.
>
> A more complete description of why we are doing this can be found
> in the original posting[1] for those that haven't seen it yet.
>
> This represents just over 1/2 the PCI drivers that have their Kconfig
> as bool but needlessly use modular references. The remainder do not
> deliver exact binary equivalence, since they delete unused __exit
> functions and/or unused ".remove" functions. So they are more
> appropriate for submission earlier in the next development window.
>
> Build tested for allmodconfig on several arch, including ARM and
> ARM-64 on the most recent linux-next baseline.
>
> Paul.
>
> [1] https://lkml.kernel.org/r/1449970917-12633-1-git-send-email-paul.gortmaker@windriver.com
> [2] https://lkml.kernel.org/r/1454889644-27830-1-git-send-email-paul.gortmaker@windriver.com
>
> ---
>
> [vs v1 in [1] above, I tweaked the subjects slightly to match the
> format used by most PCI commits, i.e drop the "driver/" prefix. ]
>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: David Daney <david.daney@cavium.com>
> Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Jesper Nilsson <jesper.nilsson@axis.com>
> Cc: Jingoo Han <jingoohan1@gmail.com>
> Cc: Joao Pinto <jpinto@synopsys.com>
> Cc: Minghuan Lian <minghuan.Lian@freescale.com>
> Cc: Mingkai Hu <mingkai.hu@freescale.com>
> Cc: Murali Karicheri <m-karicheri2@ti.com>
> Cc: Niklas Cassel <niklas.cassel@axis.com>
> Cc: Phil Edworthy <phil.edworthy@renesas.com>
> Cc: Pratyush Anand <pratyush.anand@gmail.com>
> Cc: Roy Zang <tie-fei.zang@freescale.com>
> Cc: Simon Horman <horms@verge.net.au>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Tanmay Inamdar <tinamdar@apm.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Cc: Valentine Barshak <valentine.barshak@cogentembedded.com>
> Cc: Will Deacon <will.deacon@arm.com>
> Cc: Zhou Wang <wangzhou1@hisilicon.com>
> Cc: linux-pci@vger.kernel.org
> Cc: linux-tegra@vger.kernel.org
>
> Paul Gortmaker (14):
> PCI: armada8k: make it explicitly non-modular
> PCI: artpec6: make it explicitly non-modular
> PCI: designware-plat: make it explicitly non-modular
> PCI: generic: make it explicitly non-modular
> PCI: hisi: make it explicitly non-modular
> PCI: keystone: make it explicitly non-modular
> PCI: layerscape: make it explicitly non-modular
> PCI: mvebu: make it explicitly non-modular
> PCI: rcar: make it explicitly non-modular
> PCI: rcar-gen2: make it explicitly non-modular
> PCI: tegra: make it explicitly non-modular
> PCI: thunder-ecam: make it explicitly non-modular
> PCI: thunder-pem: make it explicitly non-modular
> PCI: xgene: make it explicitly non-modular
>
> drivers/pci/host/pci-host-generic.c | 10 ++--------
> drivers/pci/host/pci-keystone.c | 10 ++--------
> drivers/pci/host/pci-layerscape.c | 10 ++--------
> 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/pci-thunder-ecam.c | 8 ++------
> drivers/pci/host/pci-thunder-pem.c | 8 ++------
> drivers/pci/host/pci-xgene.c | 8 ++------
> drivers/pci/host/pcie-armada8k.c | 14 +++++---------
> drivers/pci/host/pcie-artpec6.c | 10 ++--------
> drivers/pci/host/pcie-designware-plat.c | 10 ++--------
> drivers/pci/host/pcie-hisi.c | 13 ++-----------
> drivers/pci/host/pcie-rcar.c | 11 ++++-------
> 14 files changed, 38 insertions(+), 108 deletions(-)
Applied to pci/demodularize-hosts for v4.8, thanks, Paul!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-22 21:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-02 23:13 [PATCH 00/14] PCI: trivial demodularization of builtin code Paul Gortmaker
2016-07-02 23:13 ` [PATCH 11/14] PCI: tegra: make it explicitly non-modular Paul Gortmaker
2016-07-22 21:52 ` [PATCH 00/14] PCI: trivial demodularization of builtin code Bjorn Helgaas
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).