From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v3] drivercore: Add driver probe deferral mechanism
Date: Thu, 22 Sep 2011 23:02:55 -0600 [thread overview]
Message-ID: <20110923050255.GB24631@ponder.secretlab.ca> (raw)
In-Reply-To: <20110922234737.05dff9f8@lxorguk.ukuu.org.uk>
On Thu, Sep 22, 2011 at 11:47:37PM +0100, Alan Cox wrote:
> > How would a given driver know that something else is waiting for it? Or
> > would we add the explicit kick to each and every driver in the tree?
>
> I think there are very very few drivers that have this property and don't
> already implicitly cause a probe by creating a new bus or device.
>
> Those drivers that set something up for another device really should
> know what is going on because they are making a guarantee that they are
> ready for the other device to call into them or whatever is going on at
> some point, either explicitly in the kick or implicitly in returning from
> their probe method.
I disagree. There are lots of situations we're hitting where the
providing driver and the consuming driver don't have any details about
each other except for the name/reference of the resource (be it gpio,
phy, clock, regulator; each with a different API).
Example 1: ALSA SoC complex. A codec sitting on an i2c bus that gets
bound to an i2c_driver and attached to a memory-mapped I2S controller
driven by a platform_driver. The sound device cannot be created until
both the i2c codec and the i2s controller are bound to their drivers.
Example 2: an SDHCI controller which uses a couple of GPIO lines for
card detect and write protect, but the board designer may choose to
use any available gpio line, such as on an spi gpio expander.
Example 3: An Ethernet controller attached to a phy on a completely
independent MDIO bus. The Ethernet driver uses the phylib api to
access the phy, but cannot do so until after the phy device is bound
to a driver.
These are three very quickly off the top of my head. I can easily
come up with a lot more.
The whole point is that the consumers *don't* and *should not* know anything
how its required resources are provided. The consumer only knows how
to request them. Similarly, providers don't know anything about which
devices are going to be requesting resources from them. They can only
publish what they provide.
Now, if I'm understanding what you're suggesting, we could cause the
re-probe to be triggered only when new gpio banks, phys, clocks,
regulators, audio codecs, audio busses, interrupt controllers, and dma
engines are registered. This means adding the trigger call to all the
registration paths we think are relevant. Personally, I really don't
think this is going to be worth it given the projected order of
complexity. It is because the dependencies could be any interface
provided by another driver, I don't want to start with limitations on
exactly which interfaces can use probe deferral.
g.
next prev parent reply other threads:[~2011-09-23 5:02 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-22 18:51 [RFC PATCH v3] drivercore: Add driver probe deferral mechanism Grant Likely
2011-09-22 18:58 ` Joe Perches
2011-09-22 20:29 ` Alan Cox
2011-09-22 21:19 ` Grant Likely
2011-09-23 17:50 ` Valdis.Kletnieks at vt.edu
2011-09-23 23:18 ` Grant Likely
[not found] ` <4E7BA661.7070903@cavium.com>
2011-09-22 22:47 ` Alan Cox
2011-09-23 5:02 ` Grant Likely [this message]
2011-09-23 16:55 ` David Daney
2011-09-26 14:16 ` Mark Brown
2011-09-26 15:12 ` Russell King - ARM Linux
2011-09-26 15:26 ` Mark Brown
2011-09-26 15:48 ` Grant Likely
2011-09-27 13:50 ` Arnd Bergmann
2011-09-27 21:08 ` Grant Likely
2011-09-27 22:13 ` Mark Brown
2011-09-28 13:04 ` Arnd Bergmann
2011-09-28 13:20 ` Mark Brown
2011-09-28 23:14 ` Grant Likely
2011-09-29 11:00 ` Mark Brown
2011-10-03 23:02 ` Kevin Hilman
2011-10-04 15:52 ` Grant Likely
2011-10-04 14:51 ` G, Manjunath Kondaiah
2011-10-04 15:58 ` Grant Likely
2011-10-04 18:35 ` G, Manjunath Kondaiah
2011-10-04 23:35 ` Grant Likely
2011-10-07 3:31 ` G, Manjunath Kondaiah
2011-10-11 20:47 ` Andrew Morton
[not found] ` <4E94B01D.2050402@cavium.com>
2011-10-13 4:19 ` Grant Likely
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=20110923050255.GB24631@ponder.secretlab.ca \
--to=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.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).