linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Anson Huang <anson.huang@nxp.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Will Deacon <will@kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Olof Johansson <olof@lixom.net>,
	Russell King <linux@armlinux.org.uk>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	"oleksandr.suvorov@toradex.com" <oleksandr.suvorov@toradex.com>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Vinod Koul <vkoul@kernel.org>,
	Andreas Kemnade <andreas@kemnade.info>,
	dl-linux-imx <linux-imx@nxp.com>,
	Sascha Hauer <kernel@pengutronix.de>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Adam Ford <aford173@gmail.com>, Leo Li <leoyang.li@nxp.com>,
	Fabio Estevam <festevam@gmail.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"hverkuil-cisco@xs4all.nl" <hverkuil-cisco@xs4all.nl>
Subject: Re: [PATCH 1/3] gpio: mxc: Support module build
Date: Thu, 16 Jul 2020 15:54:55 +0200	[thread overview]
Message-ID: <CACRpkda2gdu8FsSM0MC6g8C1mebmVc5dFWJZwNvQUPXNi5bnkQ@mail.gmail.com> (raw)
In-Reply-To: <DB3PR0402MB3916FB27846F462C2210C3BFF57E0@DB3PR0402MB3916.eurprd04.prod.outlook.com>

On Wed, Jul 15, 2020 at 4:44 AM Anson Huang <anson.huang@nxp.com> wrote:

> > Subject: RE: [PATCH 1/3] gpio: mxc: Support module build
> >
> > Hi, Linus
> >
> > > Subject: Re: [PATCH 1/3] gpio: mxc: Support module build
> > >
> > > On Wed, Jul 8, 2020 at 1:28 AM Anson Huang <Anson.Huang@nxp.com>
> > > wrote:
> > >
> > > >  subsys_initcall(gpio_mxc_init);
> > > > +
> > > > +MODULE_AUTHOR("Shawn Guo <shawn.guo@linaro.org>");
> > > > +MODULE_DESCRIPTION("i.MX GPIO Driver"); MODULE_LICENSE("GPL");
> > >
> > > You are making this modualrizable but keeping the subsys_initcall(),
> > > which doesn't make very much sense. It is obviously not necessary to
> > > do this probe at subsys_initcall() time, right?
> > >
> >
> > If building it as module, the subsys_initcall() will be equal to module_init(), I
> > keep it unchanged is because I try to make it identical when built-in, since
> > most of the config will still have it built-in, except the Android GKI support.
> > Does it make sense?
> >
> > > Take this opportunity to convert the driver to use
> > > module_platform_driver() as well.
> >
> > If you think it has to be or it is better to use module_platform_driver(), I will do
> > it in V2.
>
> I tried to replace the subsys_initcall() with module_platform_driver(), but met issue
> about " register_syscore_ops(&mxc_gpio_syscore_ops);" which is called in gpio_mxc_init()
> function, this function should be called ONLY once, moving it to .probe function is NOT
> working, so we may need to keep the gpio_mxc_init(), that is another reason that we may
> need to keep subsys_initcall()?

This looks a bit dangerous to keep like this while allowing this
code to be used from a module.

What happens if you insmod and rmmod this a few times, really?
How is this tested?

This is not really modularized if that isn't working, just that modprobing
once works isn't real modularization IMO, it seems more like a
quick and dirty way to get Androids GKI somewhat working with the module
while not properly making the module a module.

You need input from the driver maintainers on how to handle this.

Yours,
Linus Walleij

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

  reply	other threads:[~2020-07-16 13:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-07 23:25 [PATCH 1/3] gpio: mxc: Support module build Anson Huang
2020-07-07 23:25 ` [PATCH 2/3] arm64: defconfig: Build in CONFIG_GPIO_MXC by default Anson Huang
2020-07-07 23:25 ` [PATCH 3/3] ARM: imx_v6_v7_defconfig: " Anson Huang
2020-07-10 11:16   ` Andreas Kemnade
2020-07-10 13:29     ` Anson Huang
2020-07-11 21:17 ` [PATCH 1/3] gpio: mxc: Support module build Linus Walleij
2020-07-12  1:34   ` Anson Huang
2020-07-15  2:44     ` Anson Huang
2020-07-16 13:54       ` Linus Walleij [this message]
2020-07-16 14:37         ` Anson Huang
2020-07-17 12:01           ` Linus Walleij
2020-07-17 12:14             ` Greg KH
2020-07-17 12:27               ` Geert Uytterhoeven
2020-07-17 13:21                 ` Greg KH
2020-07-17 13:54                   ` Arnd Bergmann
2020-07-17 14:13                     ` Greg KH
2020-07-17 15:36                       ` Mark Brown
2020-07-17 13:02               ` Arnd Bergmann
2020-07-17 13:23                 ` Greg KH
2020-07-17 13:44               ` Linus Walleij
2020-07-21  0:04             ` John Stultz

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=CACRpkda2gdu8FsSM0MC6g8C1mebmVc5dFWJZwNvQUPXNi5bnkQ@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=aford173@gmail.com \
    --cc=andreas@kemnade.info \
    --cc=anson.huang@nxp.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=festevam@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kernel@pengutronix.de \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=oleksandr.suvorov@toradex.com \
    --cc=olof@lixom.net \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=vkoul@kernel.org \
    --cc=will@kernel.org \
    /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).