linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Anson Huang <anson.huang@nxp.com>
Cc: Russell King - ARM Linux <linux@armlinux.org.uk>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Sascha Hauer <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Peter Chen <peter.chen@nxp.com>,
	"oleksandr.suvorov@toradex.com" <oleksandr.suvorov@toradex.com>,
	Andreas Kemnade <andreas@kemnade.info>,
	Peng Fan <peng.fan@nxp.com>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Olof Johansson <olof@lixom.net>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Patrice Chotard <patrice.chotard@st.com>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Joel Stanley <joel@jms.id.au>, Lubomir Rintel <lkundrak@v3.sk>,
	Christian Gmeiner <christian.gmeiner@gmail.com>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Leo Li <leoyang.li@nxp.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	"michael@walle.cc" <michael@walle.cc>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH V2 1/4] gpio: mxc: Support module build
Date: Mon, 27 Jul 2020 15:41:41 +0200	[thread overview]
Message-ID: <CAK8P3a06tu4UgTxT4q9eS4=z5AHiEWQMhk5PfZEz=4t+f26s5Q@mail.gmail.com> (raw)
In-Reply-To: <DB3PR0402MB3916634EA84687D6C7535BC1F5720@DB3PR0402MB3916.eurprd04.prod.outlook.com>

On Mon, Jul 27, 2020 at 2:23 PM Anson Huang <anson.huang@nxp.com> wrote:
> > Subject: Re: [PATCH V2 1/4] gpio: mxc: Support module build
> >
> > > So, could you please help advise how to proceed it for this GPIO
> > > driver to  support loadable module?
> >
> > I would start by getting a reference board to work with a kernel in which all
> > drivers are built-in except for the pinctrl driver, to see what exactly breaks
> > when you do that, and what other drivers may have the same problems.
> > Maybe it's not that bad after all and you only need a few modifications.
> >
>
> I agreed, but the situation is i.MX SoC contains more than 20 modules, and most of
> them are NOT owned by me, so I am NOT sure when the module owner will start
> working on the support. And if with minimum devices enabled, such as tiny kernel
> with ramfs, it is working even with pinctrl/clock etc. built as loadable module.

Do you have an example that is actually broken? I checked how the gpio
chip is actually used and found that "regulator-fixed", "virtual,mdio-gpio",
"regulator-gpio", "gpio-leds", "marvell,mv88e6085", "microchip,usb2513b",
"fsl,imx7d-usdhc", "fsl,imx6sx-fec", "mmc-pwrseq-simple", "brcm,bcm43438-bt",
 "rohm,bd71837", "nxp,pca9546",  "rtc-m41t80", should all work fine here.

I'm not sure about "fsl,mma8451", maybe test that one manually or look
at the driver in more detail.

"fsl,imx8mq-pcie" looks broken but easily fixed, and this is something we
have already discussed.

imx8mq-nitrogen.c has a "vsel-gpios" property in its "fcs,fan53555"
device node that is neither part of the binding nor handled by the
driver, so this is broken regardless of the gpio driver.

> Meanwhile, as you said, most of the users are still using built-in model, so adding the
> support for GPIO can be in parallel with other modules' work, in other words, with this
> GPIO loadable module support patch, if other modules can NOT work due to lack of
> defer probe implementation, then the patch should be done in other module, adding
> that the default configuration of GPIO is still built-in, do you think it can be an independent
> patch and get into linux-next first?

I think you should be reasonably sure that making the driver a loadable module
does not break other drivers that might rely on the probe order and
that are known
to be used with an i.MX chip. With the list above, that seems to actually be
the case for the most part, but testing is always better.

If there are boards that use other drivers which do not support deferred probing
but don't have those listed in the dts files in the kernel, then that
is not something
you have to worry about I think.

I'll let Linus Walleij comment on whether he thinks the initcall should stay
at subsys_initcall() to avoid breaking users with buggy drivers, or whether
this should be changed to module_init() or builtin_platform_driver() to
have a better chance of finding and fixing those broken drivers.

     Arnd

  reply	other threads:[~2020-07-27 13:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-22  1:45 [PATCH V2 1/4] gpio: mxc: Support module build Anson Huang
2020-07-22  1:45 ` [PATCH V2 2/4] arm64: defconfig: Build in CONFIG_GPIO_MXC by default Anson Huang
2020-07-22  1:45 ` [PATCH V2 3/4] ARM: imx_v6_v7_defconfig: " Anson Huang
2020-07-22  1:45 ` [PATCH V2 4/4] ARM: multi_v7_defconfig: " Anson Huang
2020-07-22  8:15 ` [PATCH V2 1/4] gpio: mxc: Support module build Arnd Bergmann
2020-07-27  8:18   ` Anson Huang
2020-07-27 10:44     ` Arnd Bergmann
2020-07-27 11:21       ` Anson Huang
2020-07-27 11:56         ` Arnd Bergmann
2020-07-27 12:23           ` Anson Huang
2020-07-27 13:41             ` Arnd Bergmann [this message]
2020-09-03  1:31               ` Anson Huang
2020-09-12  9:56                 ` Linus Walleij
2020-09-14  2:19                   ` Anson Huang
2020-07-28  8:09           ` Linus Walleij
2020-07-28  7:59       ` Linus Walleij
2020-07-28 11:25         ` Viresh Kumar

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='CAK8P3a06tu4UgTxT4q9eS4=z5AHiEWQMhk5PfZEz=4t+f26s5Q@mail.gmail.com' \
    --to=arnd@arndb.de \
    --cc=alexandre.torgue@st.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=christian.gmeiner@gmail.com \
    --cc=festevam@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=joel@jms.id.au \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linus.walleij@linaro.org \
    --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=lkundrak@v3.sk \
    --cc=m.szyprowski@samsung.com \
    --cc=michael@walle.cc \
    --cc=oleksandr.suvorov@toradex.com \
    --cc=olof@lixom.net \
    --cc=patrice.chotard@st.com \
    --cc=peng.fan@nxp.com \
    --cc=peter.chen@nxp.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@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).