sysfs stuff (Re: hopluggable detection broken since apparently 2.6.20)

David Zeuthen david at fubar.dk
Mon Mar 5 14:43:11 PST 2007


On Mon, 2007-03-05 at 23:25 +0300, Andrey Borzenkov wrote:
>   pci_10b9_5237
>     usb_device_0_0_0000_00_02_0
>       usb_device_90c_1000_AA04012700008619
>         usb_device_90c_1000_AA04012700008619_if0
>         usb_device_90c_1000_AA04012700008619_scsi_host
>           usb_device_90c_1000_AA04012700008619_scsi_host_scsi_device_lun0
>             storage_serial_090c_Cn_Memory_AA04012700008619
>               volume_uuid_C2F8_E4F2

This is wrong; the scsi_device should be a child of scsi_host.
Something, most likely this commit

http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=e6d942a65d9e0fdebf6367b1f874742066bce73b;hp=de7ada8fd2a5675554d6723b9145afa4e719e8a0

broke this. We _cannot_ ignore linux.sysfs_path_device as long as the
kernel / udev still gives us things like this

 UDEV  [1173133515.794707] add@/class/scsi_host/host11
 UDEV_LOG=3
 ACTION=add
 DEVPATH=/class/scsi_host/host11
 SUBSYSTEM=scsi_host
 SEQNUM=1265
 PHYSDEVPATH=/devices/pci0000:00/0000:00:1d.7/usb5/5-1/5-1:1.0/host11
 UDEVD_EVENT=1

because then we will use /sys/class/scsi_host/host11 as the sysfs path
and of course the child

 UEVENT[1173133520.730044]  add@/devices/pci0000:00/0000:00:1d.7/usb5/5-1/5-1:1.0/host11/target11:0:0/11:0:0:0
 ACTION=add
 DEVPATH=/devices/pci0000:00/0000:00:1d.7/usb5/5-1/5-1:1.0/host11/target11:0:0/11:0:0:0
 SUBSYSTEM=scsi
 SEQNUM=1269
 PHYSDEVBUS=scsi

is then not going to be have host11 as a parent. That was the whole
rationale of linux.sysfs_path_device - to be used as the sysfs path of
the device inside the /sys/devices tree. Solely to be used for finding
parents. I *thought* (perhaps I was wrong, I'm not trying to be
defensive here) that the big sysfs change meant that all devices would
sit in /sys/devices and that

 CONFIG_SYSFS_DEPRECATED=y

simply meant that e.g. /sys/class/foo/foo42 and /sys/block/sdc would
point into /sys/devices and that DEVPATH as given by the kernel would
also point there such that you could make meaningful comparisons for
determining parents. Kay, wasn't that the point? How does it look with
setting CONFIG_SYSFS_DEPRECATED=n?

FWIW, I'm on Fedora Rawhide's 2.6.20-1.2925 which is 2.6.20 vanilla plus
some RH special sauce (krh's Firewire stack for example) that shouldn't
make a difference wrt sysfs. And yeah, here we have
CONFIG_SYSFS_DEPRECATED=y probably like many other vendors.

Anyway, I think we need that patch reverted until such a time we can
depend on kernel that acts like we expect or at least until I understand
the situation a bit better (am not trying to point fingers here). For
the record, reverting said patch and fixing things up at least fixes
hotplug. Coldplug is still broken. Looking into it. I haven't pushed any
changes yet; I want to get some input from Kay on this. Thanks.

     David




More information about the hal mailing list