[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: More on hotplug issue w/HAL

On Mon, 2004-01-05 at 00:27, Matthew Mastracci wrote:
> I'm learning a lot by taking a look inside the guts of hald.  :)
> I've taken a look and it seems as if my removable drive is also having
> trouble being picked up by hal when hotplugged.  The SCSI host and
> interface devices appear, but no disk appears beneath.  When starting
> hald, the probing correctly picks up this disk.  
> Note that I've added an extra HAL_INFO call before a few
> ds_device_async_find_by_key_value_string calls, and in some
> *_got_parent() methods to determine what it was actually looking for:

Hi, I've just committed some more debug in CVS. Could you use this and
send the same output as well as the output from lshal? I'm quite sure
you found a bug, so let's try to fix it!

> /dev/hde5 mounted at /mnt/ext, major:minor=33:5, fstype=ext3,
> udi=/org/freedesktop/Hal/devices/block_33_5
> and then, 30 seconds after plugin:
> [I] linux/linux_class_block.c:220 visit_class_device_block_got_parent()
> : data2=0x00000000, d=0x091474a0,
> d->udi=/org/freedesktop/Hal/devices/temp/95, parent->udi=no parent,
> parent->in_gdl=42
> [W] linux/linux_class_block.c:224 visit_class_device_block_got_parent()
> : No parent for block device!
> So, it seems like it can't find the parent for /initrd/sys/block/sdf, so
> it can't add sdf itself.  
> I have noticed that there is a SCSI interface device underneath the USB
> drive's node with a path of:
> /initrd/sys/devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.1/2-1.1:1.0/host20/20:0:0:0
> The log line above (For xxx, parent = xxx) shows that we're looking for
> this node:
> /initrd/sys/devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.1/2-1.1:1.0/host20/20:0:0:0
> They match, but the node doesn't seem to get found.

Yes, looks like a bug.

> I thought it was a race condition, but I can clearly see the SCSI
> device/host getting added before the block device.  It's just that the
> block device ends up getting no parent!
> This device is definitely hotplugged:
> [root matt root]# cat /tmp/hal.txt | grep "DEVPATH"
> DEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.1
> DEVPATH=/class/scsi_host/host20
> DEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.1/2-1.1:1.0/host20/20:0:0:0
> DEVPATH=/block/sdf
> DEVPATH=/block/sdf/sdf1
> DEVPATH=/class/scsi_device/20:0:0:0
> DEVPATH=/devices/pci0000:00/0000:00:02.0/usb2/2-1/2-1.1/2-1.1:1.0

You can actually see here that the devices are not added in order -
that's why I need to have asynchronous find_parent functions which kind
of complicates everything.

Thanks for testing so far!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]