mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: david@lang.hm
To: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Adrian Bunk <bunk@stusta.de>, Greg K-H <greg@kroah.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Duncan Sands <duncan.sands@math.u-psud.fr>
Subject: Re: Please revert 5adc55da4a7758021bcc374904b0f8b076508a11 (PCI_MULTITHREAD_PROBE)
Date: Wed, 9 May 2007 09:18:10 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0705090910050.4467@asgard.lang.hm> (raw)
In-Reply-To: <20070509152024.1a57d82a@gondolin.boeblingen.de.ibm.com>

On Wed, 9 May 2007, Cornelia Huck wrote:

> On Wed, 9 May 2007 02:25:10 -0700 (PDT),
> david@lang.hm wrote:
>
>> makeing up an example
>>
>> today the process would be
>> call driver X to initialize it's devices.
>>
>> driver X follows these steps
>>
>> 1. see if a compatible chipset/device appears to be available
>>
>> 2. initialize the chipset/device (loading firmware)
>>
>> 3. query the now partially initialized chipset/device to see what specific
>> options are enabled in the hardware
>>
>> 4. for each 'thing' that's enabled in hardware, initialize and register
>> it.
>
> The sync ->probe() could return after step 1 (when it is clear the
> driver wants to bind to the device). The remainder should be done in
> the async function, so that the bus could go on with other devices. The
> driver should then signal when it is done with its registrations.

but then won't the devices get registered in a random order? (i.e. 
whenever the async portion finishes the probing and finds the details of 
what there is to register)

>> to acommodate both of these device models it seems to me that you can't
>> defice either
>> async followed by sync
>> or
>> sync followed by async
>> but instead need to support the combined
>> sync followed by async followed by sync.
>>
>> now, it's very possible that I'm mistaken and one of the two-part models
>> can be used for everything, if so then it's definantly simpler to do so.
>
> Hm, maybe I'm dense, but I really don't understand the problem here.
> Why should (optional) sync followed by (optional) async followed by bus
> synchonization not cover all cases? The async portion can also do some
> "sync" stuff and then signal completion, can't it?
>
> If you're worried about notifications to userspace, you could first
> suppress the add uevent via uevent_suppress and then generate it when
> you signal completion to the bus.

I'm not worried about notification to userspace, I'm worried about devices 
getting registered during the async stage appearing in different orders on 
different boots due to different timeings.

if you can identify the device well enough to register it quickly then the 
approach that Linus proposed works well, which is

sync probe, identify devices, register devices
async initialize devices
wait for all async to complete

however I'm talking about cases where you can't fully identify the devices 
(at least not well enough to register them with the kernel) and am saying 
that doing

sync probe
async initialize device, register device
wait for all async to complete

results in unpredictable device ordering, but if instead you did

sync probe
async initialize device
sync wait for all async to complete, register device

you can get back to predictable ordering

David Lang


  reply	other threads:[~2007-05-09 16:21 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
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 [this message]
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=Pine.LNX.4.64.0705090910050.4467@asgard.lang.hm \
    --to=david@lang.hm \
    --cc=bunk@stusta.de \
    --cc=cornelia.huck@de.ibm.com \
    --cc=duncan.sands@math.u-psud.fr \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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®