From: Stefan Agner <stefan@agner.ch>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
Shawn Guo <shawn.guo@freescale.com>,
Sascha Hauer <kernel@pengutronix.de>,
linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Grant Likely <grant.likely@linaro.org>
Subject: Re: [PATCH 3/4] gpio: vf610: add gpiolib/IRQ chip driver for Vybird
Date: Wed, 24 Sep 2014 17:14:49 +0200 [thread overview]
Message-ID: <2543d19c268e9ef1609759e98f3818d9@agner.ch> (raw)
In-Reply-To: <CACRpkdbJePuG0g=AFGqjDS4=yW0CXnkpf1Yr_1P4e9Kkpu9n-g@mail.gmail.com>
Am 2014-09-24 13:10, schrieb Linus Walleij:
> On Tue, Sep 23, 2014 at 1:51 PM, Stefan Agner <stefan@agner.ch> wrote:
>> [Me]
>>> postcore again. I don't like this, can you get rid of it?
>>
>> I guess we could load this driver easily a bit later. IMHO, since lots
>> of other driver use GPIO's, we should it load before all the drivers
>> gets loaded (before device_initcall).
>
> Nope. We use deferred probing to control that today. Ideally
> all drivers should be device_initcall() and deferred probe be used
> to order things, not by playing around with initcalls.
>
You can not "nope" my humble opinion, this is not possible, its write
protected! :-)
I fully understand the deferred probe approach, and I also think its
really a good approach for almost all drivers. The system by itself
makes sure the drivers are loaded in correct order. But if all drivers
use pinctrl, and the pinctrl happens to be the last initialized driver,
I first get 30 messages with probe deferred before the pinctrl driver
finally gets initialized. IMHO, this is a waste of resources... Giving
the system some hint what we need early (e.g. pinctrl or even GPIO
drivers) is just sensible. But maybe I miss something here...
Fact is, currently, without touching GPIO infrastructure code, the GPIO
driver can not be deferred when the pinctrl driver is missing. The
of_gpiochip_add_pin_range function does not handle the missing pinctrl
driver. Hence as of now, the pinctrl still needs an earlier initcall.
But anyway, currently the pinctrl driver is already using arch_initcall,
this patch set is no longer touching that.
>> Most GPIO driver do this, some statistic again:
>> $ grep -h -o ".*_initcall" drivers/gpio/*.c | sort | uniq -c | sort -n
>> -r
>> 33 subsys_initcall
>> 14 postcore_initcall
>> 2 device_initcall
>> 2 arch_initcall
>> 1 late_initcall
>> 1 core_initcall
>
> Yeah old legacy. There are patch attacks to get rid of this.
>
> The reason we can't just change them is because sometimes
> dependent drivers do not handle the errorpath very well can can't
> defer cleanly.
>
> With a new driver I expect deferred probe to be used.
>
Actually, the esdhc driver gets the cd-gpio directly and does not handle
EPROBE_DEFER properly, hence Vybrid would be affected too. But I
understand that we need to start somewhere. I will change the GPIO
driver to device_initcall and going to fix esdhc driver.
--
Stefan
next prev parent reply other threads:[~2014-09-24 15:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-06 16:25 [PATCH 0/4] vf610: Add GPIO support Stefan Agner
2014-09-06 16:25 ` [PATCH 1/4] pinctrl: imx: detect uninitialized pins Stefan Agner
2014-09-23 9:46 ` Linus Walleij
2014-09-06 16:25 ` [PATCH 2/4] pinctrl: imx: add gpio pinmux support for vf610 Stefan Agner
2014-09-23 9:48 ` Linus Walleij
2014-09-23 11:24 ` Stefan Agner
2014-09-06 16:25 ` [PATCH 3/4] gpio: vf610: add gpiolib/IRQ chip driver for Vybird Stefan Agner
2014-09-23 9:58 ` Linus Walleij
2014-09-23 11:51 ` Stefan Agner
2014-09-24 11:10 ` Linus Walleij
2014-09-24 15:14 ` Stefan Agner [this message]
2014-09-06 16:25 ` [PATCH 4/4] ARM: dts: vf610: Use new GPIO support Stefan Agner
2014-09-23 9:59 ` Linus Walleij
2014-09-19 17:36 ` [PATCH 0/4] vf610: Add " Linus Walleij
2014-09-23 9:28 ` Linus Walleij
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=2543d19c268e9ef1609759e98f3818d9@agner.ch \
--to=stefan@agner.ch \
--cc=gnurou@gmail.com \
--cc=grant.likely@linaro.org \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shawn.guo@freescale.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).