common.c:get_parent_sysfs_path() does not get the parent device

Kay Sievers kay.sievers at vrfy.org
Fri Nov 5 20:03:30 PST 2004


Hey David,
hald is unable to recognize all scsi bus devices of my usb stick.
A whole chain of parent object lookup fails for:
  devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1/target1:0:0/1:0:0:0

cause:
  devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1/target1:0:0

is not a device we get an event for and therefore can't be found as a
parent in the store.

sysfs:
  [kay at pim ~]$ tree /sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1
  /sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1
  |-- detach_state
  |-- power
  |   `-- state
  `-- target1:0:0
      |-- 1:0:0:0
      |   |-- block -> ../../../../../../../../../block/sda
      |   |-- delete
      |   |-- detach_state
      |   |-- device_blocked
      |   |-- driver -> ../../../../../../../../../bus/scsi/drivers/sd
      |   |-- generic -> ../../../../../../../../../class/scsi_generic/sg0
      |   |-- max_sectors
      |   |-- model
      |   |-- power
      |   |   `-- state
      |   |-- queue_depth
      |   |-- rescan
      |   |-- rev
      |   |-- scsi_level
      |   |-- state
      |   |-- timeout
      |   |-- type
      |   `-- vendor
      |-- detach_state
      `-- power
          `-- state

Here is the hald debug output with the attached patch applied,
which makes it work again by a dirty hack.

  linux/osspec.c:1727: Queing up seqnum=997, sysfspath=/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1/target1:0:0/1:0:0:0, subsys=scsi
  linux/osspec.c:1337: action=add seqnum=997 subsystem=scsi sysfs_path=/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1/target1:0:0/1:0:0:0
  linux/bus_device.c:111: parent_sysfs_path='/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1/target1:0:0/1:0:0:0' parent_sysfs_path='/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1/target1:0:0'
  linux/bus_device.c:132: XXX parent=(nil) parent_sysfs_path='/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1/target1:0:0'
  linux/bus_device.c:144: XXX grandparent=0x80bd718 parent_sysfs_path='/sys/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host1'

I'm not sure if we really can assume that every directory in sysfs
is a device we got an earlier event for?

Any ideas?

Thanks,
Kay
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-devices-grandparent.patch
Type: text/x-patch
Size: 1208 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20041106/95b625a6/hal-devices-grandparent.bin
-------------- next part --------------
_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal


More information about the Hal mailing list