From: Grant Likely <grant.likely@linaro.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Rohit Vaswani <rvaswani@codeaurora.org>,
Linus Walleij <linus.walleij@linaro.org>,
Rob Herring <rob.herring@calxeda.com>,
Rob Landley <rob@landley.net>,
Russell King <linux@arm.linux.org.uk>,
David Brown <davidb@codeaurora.org>,
Bryan Huntsman <bryanh@codeaurora.org>,
Linux Documentation List <linux-doc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCHv2 3/3] gpio: msm: Add device tree and irqdomain support for gpio-msm-v2
Date: Fri, 31 May 2013 21:56:20 +0100 [thread overview]
Message-ID: <CACxGe6vSBWSUp+p=UMsLpWcmr-b559p6xa3kPiKpvs+D4Kubiw@mail.gmail.com> (raw)
In-Reply-To: <CAHp75Ve1rSf6McAJXFohDJF9yWzhpSx3fbKp0ewxC9tpJOMhBw@mail.gmail.com>
On Fri, May 31, 2013 at 9:01 PM, Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
> On Thu, May 23, 2013 at 3:29 AM, Rohit Vaswani <rvaswani@codeaurora.org> wrote:
>> This cleans up the gpio-msm-v2 driver of all the global define usage.
>> The number of gpios are now defined in the device tree. This enables
>> adding irqdomain support as well.
>
> Besides the other comments, I have one important here.
>
>> -static int __init msm_gpio_init(void)
>> -{
>> - int rc;
>> -
>> - rc = platform_driver_register(&msm_gpio_driver);
>> - if (!rc) {
>> - rc = platform_device_register(&msm_device_gpio);
>> - if (rc)
>> - platform_driver_unregister(&msm_gpio_driver);
>> - }
>> -
>> - return rc;
>> -}
>> -
>> -static void __exit msm_gpio_exit(void)
>> -{
>> - platform_device_unregister(&msm_device_gpio);
>> - platform_driver_unregister(&msm_gpio_driver);
>> -}
>> -
>> -postcore_initcall(msm_gpio_init);
>> -module_exit(msm_gpio_exit);
>> +module_platform_driver(msm_gpio_driver)
>
> It's a really big mistake to do this.
> GPIO nowadays is used in many hardware subsystems to support early
> stages of booting and initializing.
>
> postcore_initcall is early enough to support mostly anything that
> hardware wants from GPIO (for example, ACPI events, though it seems
> not a case here).
Actually, we're going the other way in the kernel. I do agree that for
existing drivers you need to be careful and make sure that switching
the initcall level won't cause any breakage with existing systems, but
new platform support must not rely on the initcall order for setting
up gpios. That's what deferred probe is intended to solve.
g.
prev parent reply other threads:[~2013-05-31 20:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-23 0:29 [PATCHv2 0/3] Cleanup MSM_GPIOMUX and add DT support for gpio-msm Rohit Vaswani
2013-05-23 0:29 ` [PATCH 1/3] ARM: msm: Remove gpiomux-v2 and re-organize MSM_GPIOMUX configs Rohit Vaswani
2013-05-23 16:57 ` Stephen Boyd
2013-05-23 19:37 ` Rohit Vaswani
2013-05-23 0:29 ` [PATCH 2/3] ARM: msm: Remove unused and unmapped MSM_TLMM_BASE for 8x60 Rohit Vaswani
2013-05-23 0:29 ` [PATCHv2 3/3] gpio: msm: Add device tree and irqdomain support for gpio-msm-v2 Rohit Vaswani
2013-05-23 11:33 ` Stanimir Varbanov
2013-05-31 12:42 ` Grant Likely
2013-05-31 21:31 ` Rohit Vaswani
2013-05-31 20:01 ` Andy Shevchenko
2013-05-31 20:56 ` Grant Likely [this message]
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='CACxGe6vSBWSUp+p=UMsLpWcmr-b559p6xa3kPiKpvs+D4Kubiw@mail.gmail.com' \
--to=grant.likely@linaro.org \
--cc=andy.shevchenko@gmail.com \
--cc=bryanh@codeaurora.org \
--cc=davidb@codeaurora.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=rob.herring@calxeda.com \
--cc=rob@landley.net \
--cc=rvaswani@codeaurora.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).