[patch] asynchronous callouts

David Zeuthen david at fubar.dk
Sun Apr 25 11:44:38 PDT 2004


On Sun, 2004-04-25 at 14:40 -0400, Joe Shaw wrote:
> On Sun, 2004-04-25 at 20:04 +0200, David Zeuthen wrote:
> > But the patch I just committed changes this - the timeout is now always
> > 30 seconds at startup - except when visiting a toplevel device e.g. 
> > 
> >  /sys/devices/pci0000:00/0000:00:07.1
> > 
> > then we don't bother searching for a parent. So this is immediately
> > added to the GDL. At some point we visit this device
> > 
> >  /sys/devices/pci0000:00/0000:00:07.1/ide0
> > 
> > and this waits (up until 30 seconds) until the device with the sysfs
> > path /sys/devices/pci0000:00/0000:00:07.1 is in the GDL. So this works. 
> 
> Ah, ok, this should work fine then for toplevel devices.  Is there ever
> a case when there are multiple levels of children (at least at startup)?

Yeah, for e.g. usb-storage it looks like this

 - pci-device
  - usb root
   - usb interface
    - scsi host
     - scsi device
      - block
       - block

> If so, the problem will still be there.
> 

I actually think it will work fine in every case. 

When hald starts up all the devices in the chain above is visited and in
the tdl - they start by waiting for the parent; when the parent is there
they execute the callouts c0,c1,.. and when the callouts are complete
they are in the gdl. Let's assume it takes 2 secs to complete the
callouts (way to high, but..)

Initially to start the process, pci-device just executes the callouts
(it doesn't wait for a parent since the sysfs path indicates that there
is no parent) and is then in the gdl after 2 seconds. Then usb root got
a parent, executes the callouts and after two secs is put in to the gdl.
And so on... Wouldn't this work?

Cheers,
David


_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list