linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ddaney.cavm@gmail.com (David Daney)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v3] drivercore: Add driver probe deferral mechanism
Date: Fri, 23 Sep 2011 09:55:27 -0700	[thread overview]
Message-ID: <4E7CB9FF.5020401@gmail.com> (raw)
In-Reply-To: <20110922234737.05dff9f8@lxorguk.ukuu.org.uk>

On 09/22/2011 03:47 PM, 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.
>

These are precisely the drivers of concern.  However it is not 
individual drivers, but whole classes of drivers.  In my case we are 
talking about GPIO drivers.

If there is a dependency on GPIO devices, we don't know which 
device/driver will be providing the GPIO services, so at a minimum *all* 
GPIO drivers would have to add the explicit kick.

> 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.

Really the driver framework is there to do all this already.  Once the 
probe method is called, the device is usually presented as 'ready' in 
some sense.

The problem this patch solves is to make it work when there are ad hoc 
relationships between the devices that cannot be represented in a tree 
like structure presented by the bus/driver topology of the driver framework.

If there are no deferred probes necessary, the only overhead is a single 
check to see if work needs to be done.  Since in this case, nothing 
needs to be done...  Nothing is done.


>
> I know which I think is clearer and easier for a 3rd party to see and not
> miss completely when updating code.

?? I don't understand that statement.

A handful of lines of code in the driver core vs. having to wonder, and 
then get it right, for each and every driver if there could be a 
dependency outside of the bus framework.

  parent reply	other threads:[~2011-09-23 16:55 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
2011-09-23 16:55       ` David Daney [this message]
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=4E7CB9FF.5020401@gmail.com \
    --to=ddaney.cavm@gmail.com \
    --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).