From: Linus Torvalds <torvalds@linux-foundation.org>
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Adrian Bunk <bunk@stusta.de>, Greg K-H <greg@kroah.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Please revert 5adc55da4a7758021bcc374904b0f8b076508a11 (PCI_MULTITHREAD_PROBE)
Date: Tue, 8 May 2007 13:01:21 -0700 (PDT) [thread overview]
Message-ID: <alpine.LFD.0.98.0705081249540.3882@woody.linux-foundation.org> (raw)
In-Reply-To: <alpine.LFD.0.98.0705081227230.3882@woody.linux-foundation.org>
On Tue, 8 May 2007, Linus Torvalds wrote:
>
> But the final nail in the coffin is that doing it at the bus level is
> INFERIOR. As you yourself admitted, it's better to do some things
> synchronously.
Side note: there may well be clever combinations of "bus side" support
*together* with per-device rules.
For example, right now we probe devices by calling their "probe()"
routines synchronously. Changing that to be asynchronous simply isn't an
option, because we've seen drivers that get unhappy (and the hotplug
argument isn't an argument: *most* drivers aren't even hotplug-capable
anyway).
BUT.
Instead of changing existign probe functionality to be asynchronous, we
could *add* a new and asynchronous part to it. For example, we could make
the rule for PCI - or other bus - devices be:
- the bus will *first* call the "probe()" function synchronously.
- after that one has completed, we will call "probe_async()"
asynchronously at some point (it ie might be scheduled immediately
after the "probe()" call, but delayed by some arbitrary issues like
just already having too many asynchronous probes on-going or similar)
(A variation of the above might be that *everybody*s synchronous probe
function will be called first, and then the asynchronous probe functions
will be called only when they are all done. That might help with drivers
that have dependencies between different PCI functions - Cardbus comes to
mind, where the different slots look like independent PCI devices, but
slot zero is literally the master and controls some of the functions on
slot 1 too - similar issues may well happen in other multi-function
devices, and it might simplify things if you knew that the serial probe
had completed fully before the asynchronous parallel part even starts).
So an unmodified driver would basically work exactly like it does now, but
if a driver is happy with being called asynchronously, it could just
change it's
.probe = mydriver_probe
thing into a
.probe_async = mydriver_probe
and we can do that ona per-driver basis with that kind of really simple
one-liner change.
In fact, there is nothing wrong with having *both* a synchronous part, and
an async part:
.probe = mydriver_setup,
.probe_async = mydriver_spin_up_and_probe_devices,
and it would do basic setup (including, for example, the fast enumeration
of whatever devices are connected) synchronously, but then do anything
more in the async part - and the async part would still be guaranteed that
the setup has been run by the time it is scheduled (but not really have
any other guarantees).
Hmm? Would something like this work? I dunno, but it seems a hell of a lot
safer and more capable than the aborted PCI multithreaded probing that was
an "all or nothing" approach.
Linus
next prev parent reply other threads:[~2007-05-08 20:02 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-08 13:37 Cornelia Huck
2007-05-08 14:07 ` Greg KH
2007-05-08 20:58 ` David Miller
2007-05-09 9:44 ` Greg KH
2007-05-09 17:21 ` Linus Torvalds
2007-05-08 14:11 ` Adrian Bunk
2007-05-08 14:41 ` Cornelia Huck
2007-05-08 15:27 ` Linus Torvalds
2007-05-08 16:38 ` Cornelia Huck
2007-05-08 16:47 ` david
2007-05-08 21:45 ` Stefan Richter
2007-05-08 18:30 ` Linus Torvalds
2007-05-08 19:21 ` Cornelia Huck
2007-05-08 19:31 ` Linus Torvalds
2007-05-08 20:01 ` Linus Torvalds [this message]
2007-05-08 20:26 ` david
2007-05-09 7:58 ` Cornelia Huck
2007-05-09 8:33 ` david
2007-05-09 9:15 ` Cornelia Huck
2007-05-09 9:25 ` david
2007-05-09 13:20 ` Cornelia Huck
2007-05-09 16:18 ` david
2007-05-09 17:07 ` Cornelia Huck
2007-05-09 17:09 ` david
2007-05-09 17:48 ` Cornelia Huck
2007-05-09 17:53 ` david
2007-05-09 18:36 ` Cornelia Huck
2007-05-09 18:52 ` david
2007-05-10 7:38 ` Cornelia Huck
2007-05-09 17:07 ` Greg KH
2007-05-09 17:25 ` Linus Torvalds
2007-05-09 9:30 ` Stefan Richter
2007-05-09 22:21 ` Phillip Susi
2007-05-09 22:37 ` Stefan Richter
2007-05-10 14:23 ` Phillip Susi
2007-05-10 14:55 ` Stefan Richter
2007-05-11 7:22 ` Cornelia Huck
2007-05-08 20:51 ` Cornelia Huck
2007-05-08 21:41 ` David Miller
2007-05-09 9:55 ` Greg KH
2007-05-09 8:14 ` Duncan Sands
2007-05-09 8:45 ` Cornelia Huck
2007-05-09 9:16 ` Duncan Sands
2007-05-09 12:37 ` Cornelia Huck
2007-05-08 20:36 ` Cornelia Huck
2007-05-09 9:53 ` Greg KH
2007-05-09 13:38 ` Cornelia Huck
2007-05-09 16:42 ` Greg KH
2007-05-09 16:50 ` david
2007-05-09 17:14 ` Cornelia Huck
2007-05-09 17:09 ` Linus Torvalds
2007-05-08 21:15 ` David Miller
2007-05-08 22:19 ` Stefan Richter
2007-05-09 9:46 ` Greg KH
2007-05-08 15:15 ` Linus Torvalds
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=alpine.LFD.0.98.0705081249540.3882@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=bunk@stusta.de \
--cc=cornelia.huck@de.ibm.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®