linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Paul Gortmaker" <paul.gortmaker@windriver.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Linux-sh list" <linux-sh@vger.kernel.org>,
	linux-pci <linux-pci@vger.kernel.org>,
	"Alexandre Courbot" <gnurou@gmail.com>,
	"Pratyush Anand" <pratyush.anand@gmail.com>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Kishon Vijay Abraham I" <kishon@ti.com>,
	"Murali Karicheri" <m-karicheri2@ti.com>,
	"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
	"Jason Cooper" <jason@lakedaemon.net>,
	"Stephen Warren" <swarren@wwwdotorg.org>,
	"Simon Horman" <horms@verge.net.au>,
	linux-tegra@vger.kernel.org,
	"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>,
	"Richard Zhu" <Richard.Zhu@freescale.com>,
	rfi@lists.rocketboards.org, "Ley Foon Tan" <lftan@altera.com>,
	"Bjorn Helgaas" <bhelgaas@google.com>,
	"Lucas Stach" <l.stach@pengutronix.de>
Subject: Re: [PATCH 00/10] drivers/pci: avoid module_init in non-modular host/pci*
Date: Mon, 14 Dec 2015 09:24:25 +0100	[thread overview]
Message-ID: <20151214082425.GA3766@ulmo.nvidia.com> (raw)
In-Reply-To: <CAMuHMdXr=ErCO3R2LB+wBJh3JSiFkH5q3-FLSTOwdGT87fXz3A@mail.gmail.com>

[-- 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 --]

  reply	other threads:[~2015-12-14  8:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` [PATCH 01/10] drivers/pci: make host/pci-imx6.c driver explicitly non-modular Paul Gortmaker
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 10:33   ` Thomas Petazzoni
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 ` [PATCH 05/10] drivers/pci: make host/pci-rcar-gen2.c " Paul Gortmaker
2015-12-13 10:59   ` Geert Uytterhoeven
2015-12-13 18:15     ` Paul Gortmaker
2015-12-13 20:37       ` Joe Perches
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-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 10:58   ` Geert Uytterhoeven
2015-12-13 18:20     ` Paul Gortmaker
2015-12-17 11:32     ` Phil Edworthy
2015-12-17 16:06       ` Paul Gortmaker
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-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 ` [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:24   ` Thierry Reding [this message]
2015-12-14  8:26     ` Michal Simek
2015-12-14  8:33     ` Ley Foon Tan
2015-12-14  9:19       ` Thierry Reding
2015-12-14 10:27         ` Arnd Bergmann
2015-12-15 15:16           ` Paul Gortmaker
2016-01-08 20:31             ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151214082425.GA3766@ulmo.nvidia.com \
    --to=thierry.reding@gmail.com \
    --cc=Richard.Zhu@freescale.com \
    --cc=bhelgaas@google.com \
    --cc=geert@linux-m68k.org \
    --cc=gnurou@gmail.com \
    --cc=horms@verge.net.au \
    --cc=jason@lakedaemon.net \
    --cc=kishon@ti.com \
    --cc=l.stach@pengutronix.de \
    --cc=lftan@altera.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.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=m-karicheri2@ti.com \
    --cc=michal.simek@xilinx.com \
    --cc=paul.gortmaker@windriver.com \
    --cc=pratyush.anand@gmail.com \
    --cc=rfi@lists.rocketboards.org \
    --cc=soren.brinkmann@xilinx.com \
    --cc=swarren@wwwdotorg.org \
    --cc=thomas.petazzoni@free-electrons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).