Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1435886 > unrolled thread

[PATCH 04/14] PCI: generic: make it explicitly non-modular

Started byPaul Gortmaker <paul.gortmaker@windriver.com>
First post2016-07-03 01:20 +0200
Last post2016-07-06 19:50 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 04/14] PCI: generic: make it explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-03 01:20 +0200
    Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular Will Deacon <will.deacon@arm.com> - 2016-07-04 19:40 +0200
      Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular Jayachandran C <jchandra@broadcom.com> - 2016-07-06 06:30 +0200
    Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular Will Deacon <will.deacon@arm.com> - 2016-07-06 19:10 +0200
      Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular Paul Gortmaker <paul.gortmaker@windriver.com> - 2016-07-06 19:50 +0200

#1435886 — [PATCH 04/14] PCI: generic: make it explicitly non-modular

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-03 01:20 +0200
Subject[PATCH 04/14] PCI: generic: make it explicitly non-modular
Message-ID<rQCmC-1hQ-39@gated-at.bofh.it>
The Kconfig currently controlling compilation of this code is:

drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
drivers/pci/host/Kconfig:       bool "Generic PCI host 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
is already contained at the top of the file in the comments.

Cc: Will Deacon <will.deacon@arm.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/pci-host-generic.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/pci/host/pci-host-generic.c b/drivers/pci/host/pci-host-generic.c
index f0ca6de0d87e..c05ea9d72f69 100644
--- a/drivers/pci/host/pci-host-generic.c
+++ b/drivers/pci/host/pci-host-generic.c
@@ -20,7 +20,7 @@
  */
 
 #include <linux/kernel.h>
-#include <linux/module.h>
+#include <linux/init.h>
 #include <linux/of_address.h>
 #include <linux/of_pci.h>
 #include <linux/pci-ecam.h>
@@ -45,8 +45,6 @@ static const struct of_device_id gen_pci_of_match[] = {
 	{ },
 };
 
-MODULE_DEVICE_TABLE(of, gen_pci_of_match);
-
 static int gen_pci_probe(struct platform_device *pdev)
 {
 	const struct of_device_id *of_id;
@@ -65,8 +63,4 @@ static struct platform_driver gen_pci_driver = {
 	},
 	.probe = gen_pci_probe,
 };
-module_platform_driver(gen_pci_driver);
-
-MODULE_DESCRIPTION("Generic PCI host driver");
-MODULE_AUTHOR("Will Deacon <will.deacon@arm.com>");
-MODULE_LICENSE("GPL v2");
+builtin_platform_driver(gen_pci_driver);
-- 
2.8.4

[toc] | [next] | [standalone]


#1436461

FromWill Deacon <will.deacon@arm.com>
Date2016-07-04 19:40 +0200
Message-ID<rRg0F-8uN-1@gated-at.bofh.it>
In reply to#1435886
On Sat, Jul 02, 2016 at 07:13:24PM -0400, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
> drivers/pci/host/Kconfig:       bool "Generic PCI host 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
> is already contained at the top of the file in the comments.

Ideally, we'd simply fix this to build as a module, but it's not clear
how to do that now that the ecam accessors have been split out into
their own file. A liberal sprinkling of EXPORT_SYMBOL might work, but
it's a bit grotty.

David, Jayachandran -- do you have any desire to build your PCI host
controller drivers as modules?

Will

[toc] | [prev] | [next] | [standalone]


#1437403

FromJayachandran C <jchandra@broadcom.com>
Date2016-07-06 06:30 +0200
Message-ID<rRMDf-4rp-7@gated-at.bofh.it>
In reply to#1436461
On Wed, Jul 6, 2016 at 1:49 AM, David Daney <ddaney@caviumnetworks.com> wrote:
>
> On 07/04/2016 10:37 AM, Will Deacon wrote:
>>
>> On Sat, Jul 02, 2016 at 07:13:24PM -0400, Paul Gortmaker wrote:
>>>
>>> The Kconfig currently controlling compilation of this code is:
>>>
>>> drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
>>> drivers/pci/host/Kconfig:       bool "Generic PCI host 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
>>> is already contained at the top of the file in the comments.
>>
>>
>> Ideally, we'd simply fix this to build as a module, but it's not clear
>> how to do that now that the ecam accessors have been split out into
>> their own file. A liberal sprinkling of EXPORT_SYMBOL might work, but
>> it's a bit grotty.
>>
>> David, Jayachandran -- do you have any desire to build your PCI host
>> controller drivers as modules?
>
>
> I can only speak to the Cavium case.
>
> The system is not usable without PCI, so there is no advantage to making the PCI host drivers modular.  At this point I don't see any reason to expend effort making it work as a module.
>

Broadcom's case is also similar - pci-host-generic would to be built-in
when booting with device tree, or it would be unnecessary when booting
with ACPI. We don't have a scenario in which having it as a module would
be useful.

JC

[toc] | [prev] | [next] | [standalone]


#1437853

FromWill Deacon <will.deacon@arm.com>
Date2016-07-06 19:10 +0200
Message-ID<rRYuK-3wy-25@gated-at.bofh.it>
In reply to#1435886
On Sat, Jul 02, 2016 at 07:13:24PM -0400, Paul Gortmaker wrote:
> The Kconfig currently controlling compilation of this code is:
> 
> drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
> drivers/pci/host/Kconfig:       bool "Generic PCI host 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
> is already contained at the top of the file in the comments.
> 
> Cc: Will Deacon <will.deacon@arm.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/pci-host-generic.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)

Given that nobody seems to need this as a module and it's not
straightforward to enable that:

Acked-by: Will Deacon <will.deacon@arm.com>

I assume you've done something similar for
drivers/pci/host/pci-host-common.c?

Will

[toc] | [prev] | [next] | [standalone]


#1437872

FromPaul Gortmaker <paul.gortmaker@windriver.com>
Date2016-07-06 19:50 +0200
Message-ID<rRZ7s-3Lq-9@gated-at.bofh.it>
In reply to#1437853
[Re: [PATCH 04/14] PCI: generic: make it explicitly non-modular] On 06/07/2016 (Wed 18:02) Will Deacon wrote:

> On Sat, Jul 02, 2016 at 07:13:24PM -0400, Paul Gortmaker wrote:
> > The Kconfig currently controlling compilation of this code is:
> > 
> > drivers/pci/host/Kconfig:config PCI_HOST_GENERIC
> > drivers/pci/host/Kconfig:       bool "Generic PCI host 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
> > is already contained at the top of the file in the comments.
> > 
> > Cc: Will Deacon <will.deacon@arm.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/pci-host-generic.c | 10 ++--------
> >  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> Given that nobody seems to need this as a module and it's not
> straightforward to enable that:
> 
> Acked-by: Will Deacon <will.deacon@arm.com>
> 
> I assume you've done something similar for
> drivers/pci/host/pci-host-common.c?

Not yet -- that one escaped my radar because it didn't have module_init
or MODULE_DEVICE_TABLE in it; it just has MODULE_AUTHOR etc.  I'll add
that fix to my queue and update my audit to hide the MODULE_AUTHOR tags
when compiling for !MODULE.

Thanks,
Paul.
--

> 
> Will

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web