From: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Walter Lozano <walter@vanguardiasur.com.ar>,
mika.westerberg@linux.intel.com, Romain.Baeriswyl@abilis.com,
atull@opensource.altera.com, raymond.tan@intel.com,
carlpeng008@gmail.com, linux-i2c@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [RFC] i2c: designware: Avoid initcall and initialize the driver like a regular one
Date: Tue, 23 Dec 2014 12:32:42 -0300 [thread overview]
Message-ID: <54998B1A.9020208@vanguardiasur.com.ar> (raw)
In-Reply-To: <20141223152621.GA3692@katana>
[-- Attachment #1: Type: text/plain, Size: 2750 bytes --]
On 12/23/2014 12:26 PM, Wolfram Sang wrote:
>
>>>> This guarantees it will probe after GPIOs drivers.
>
> BTW this is not true to the best of my knowledge. It will make that
> "very likely" but not "guarantee" anything. So, the race window is
> smaller but it is still there. You need a proper fix anyhow.
>
Right.
>>>> Platforms based on devicetree won't be affected by this change.
>>>
>>> Huh, why is that?
>>>
>>
>> Unless I'm missing something here, our beloved DeviceTree guarantees to
>> model the dependency between I2C slaves devices and the I2C master their
>> connected to.
>
> Frankly, you are missing quite some things here. The I2C core registers
> the clients when a master gets registered. No difference between
> platform and DT here.
>
>> So, a machine fully-based on DeviceTree would never attempt to use the I2C
>> bus without first registering the master, right?
>
> Neither would platform, that would be quite a bug.
>
>> This means there won't be any early users of the I2C platform driver in this
>> scenario.
>
> There won't be with platform as well.
Oh, OK. Then maybe you can clarify why all those i2c busses need to be
registered with initcall in the first place?
> But I think you are missing the
> point. We are a *consumer* of GPIOs here. All of the above has nothing
> to do with GPIO controllers being already available.
>
Hm, true. I was missing the fact that probe call order does not
guarantee a succesful probe order.
>>>> Legacy platforms, relying on the I2C being available early, might need
>>>> to implement proper defered mechanisms to overcome potential problems.
>>>
>>> NAK. We can't say "Let's cause a regression to force people to fix
>>> things that used to work" IMO. You exactly pointed out the problem that using
>>> subsys_initcall() creates.
>>>
>>> What about fixing the drivers you use to support deferred probing when
>>> acquitin the irq?
>>>
>>
>> Maybe we can fix the legacy ones instead. However, a quick look shows there
>> aren't any!
>>
>> $ git grep i2c_designware
>> drivers/i2c/busses/i2c-designware-pcidrv.c:MODULE_ALIAS("i2c_designware-pci");
>> drivers/i2c/busses/i2c-designware-platdrv.c:MODULE_ALIAS("platform:i2c_designware");
>> drivers/i2c/busses/i2c-designware-platdrv.c: .name = "i2c_designware",
>>
>> Looks like this patch is pretty harmless.
>
> In-tree you are right. Out-of-tree, you probably aren't. I wouldn't care
> about the latter if that would block a real bugfix. But since the above
> patch is not the proper fix IMO, I prefer being stable here.
>
Fair enough.
Thanks for the feedback,
--
Ezequiel Garcia, VanguardiaSur
www.vanguardiasur.com.ar
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-12-23 15:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-22 18:15 Walter Lozano
2014-12-22 19:02 ` Wolfram Sang
2014-12-23 12:53 ` Walter Lozano
2014-12-23 14:57 ` Ezequiel Garcia
2014-12-23 15:26 ` Wolfram Sang
2014-12-23 15:32 ` Ezequiel Garcia [this message]
2014-12-23 16:23 ` Wolfram Sang
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=54998B1A.9020208@vanguardiasur.com.ar \
--to=ezequiel@vanguardiasur.com.ar \
--cc=Romain.Baeriswyl@abilis.com \
--cc=atull@opensource.altera.com \
--cc=carlpeng008@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=raymond.tan@intel.com \
--cc=walter@vanguardiasur.com.ar \
--cc=wsa@the-dreams.de \
/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
all inboxes | Powered by JetHome®