From: Greg KH <gregkh@suse.de>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Kay Sievers <kay.sievers@vrfy.org>,
linux-kernel@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH] drivercore: Add driver probe deferral mechanism
Date: Tue, 5 Jul 2011 07:21:49 -0700 [thread overview]
Message-ID: <20110705142149.GA3498@suse.de> (raw)
In-Reply-To: <20110704180159.GA11278@ponder.secretlab.ca>
On Mon, Jul 04, 2011 at 12:01:59PM -0600, Grant Likely wrote:
> On Mon, Jul 04, 2011 at 10:41:26AM -0700, Greg KH wrote:
> > On Mon, Jul 04, 2011 at 11:11:59AM -0600, Grant Likely wrote:
> > > Allow drivers to report at probe time that they cannot get all the resources
> > > required by the device, and should be retried at a later time.
> >
> > When is "later"?
>
> In this case, after at least one other device has successfully probed.
> The 'later' is handled in a workqueue that walks the list
> asynchronously from normal initialization.
>
> > And why would a driver not be able to get all of the proper resources?
>
> Discussed below...
>
> > Why can't a bus, at a later time, just try to reprobe everything when it
> > determines that it is a "later" time now, without having to do this
> > added change to the core?
>
> It can't be done by a specific bus type because it has zero
> relationship with the bus type. For example, it is typical for an
> SDHCI driver to require a GPIO line for the card detect switch, and
> the device cannot be initialized until it has it. However, the
> bus_type that the SDHCI driver is attached to could be anything;
> platform_bus_type, pci, amba, etc. It isn't a bus_type deficiency,
> but rather that the driver core has no way to gracefully handle
> devices that get probed in an undetermined order.
>
> It has to be done at the core level because any device in the system,
> regardless of bus_type, may require another device to be probed first.
> Originally I tried modifying the drivers to successfully probe
> anyway and then 'go to sleep' to try again later, but it turned out to
> push a lot of complexity into the device drivers when it can be solved
> far more simply if the driver core has the ability to retry drivers
> that request it.
So the driver core is just going to sit and spin and continue to try to
probe drivers for as long as it gets that error value returned? What is
going to ever cause that loop to terminate? It seems a bit hacky to
just keep looping over and over and hoping that sometime everything will
all settle down so that we can go to sleep again.
It just doesn't feel right, there has to be some other way to handle
stuff like this in a way that is known to terminate properly other than
just guessing.
greg k-h
next prev parent reply other threads:[~2011-07-05 14:22 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-04 17:11 [PATCH] drivercore: Add driver probe deferral mechanism Grant Likely
2011-07-04 17:41 ` Greg KH
2011-07-04 17:56 ` Mark Brown
2011-07-04 18:01 ` Grant Likely
2011-07-05 14:21 ` Greg KH [this message]
2011-07-05 15:21 ` Arnd Bergmann
2011-07-05 15:50 ` Greg KH
2011-07-05 16:05 ` Arnd Bergmann
2011-07-05 16:27 ` Grant Likely
2011-07-05 16:11 ` Kay Sievers
2011-07-05 16:28 ` Grant Likely
2011-07-05 16:36 ` Greg KH
2011-07-05 17:17 ` Grant Likely
2011-07-05 17:29 ` Greg KH
2011-07-05 17:35 ` Grant Likely
2011-07-10 14:24 ` Kay Sievers
2011-07-05 16:33 ` Grant Likely
2011-07-05 16:05 ` Grant Likely
2011-07-04 19:56 ` Randy Dunlap
2011-07-04 20:47 ` Mark Brown
2011-07-04 23:25 ` Grant Likely
2011-07-05 6:11 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2012-03-05 15:47 Grant Likely
2012-03-05 17:38 ` Alan Cox
2012-03-05 17:40 ` David Daney
2012-03-05 17:50 ` Mark Brown
2012-03-05 19:15 ` Arnd Bergmann
2012-03-05 21:10 ` Grant Likely
2012-03-05 21:24 ` Greg Kroah-Hartman
2012-03-05 21:28 ` Mark Brown
2012-03-06 9:10 ` Arnd Bergmann
2012-03-05 21:47 ` Greg Kroah-Hartman
2012-03-05 22:09 ` Grant Likely
2012-03-05 22:15 ` Greg Kroah-Hartman
2012-03-06 0:08 ` Grant Likely
2012-03-06 5:28 ` Greg Kroah-Hartman
2012-03-06 7:52 ` Grant Likely
2012-03-08 20:22 ` Greg KH
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=20110705142149.GA3498@suse.de \
--to=gregkh@suse.de \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=davem@davemloft.net \
--cc=grant.likely@secretlab.ca \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
/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