Skip to contentSkip to conversation

udev regression? lsusb silent (no output) since 2.6.22-rc2 at least

DISCUSSION bert hubert 3 participants 8 messages May 26, 2007 – May 27, 2007 USB

lore
Share & tools
lore
#0 lore raw

Greg, Kay, kernel people,

Today I booted 2.6.22-rc2 on Ubunty Edgy Eft, and lsusb died on me:

ahu@intel:~$ lsusb
ahu@intel:~$ sudo lsusb
ahu@intel:~$ 

This behaviour persists in rc4. This might be udev related. I'm running:
ii udev 093-0ubuntu18.0edgy2

USB does work fine.

Bit from strace:

open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3 fstat64(3, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0

fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 4 entries */, 4096)    = 112
close(3)                                = 0
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 4 entries */, 4096)    = 112
getdents64(3, /* 0 entries */, 4096)    = 0
close(3)                                = 0

(end of program)

ahu@intel:~$ ls -l /dev/bus/usb -d
drwxr-xr-x 3 root root 80 2007-05-26 21:58 /dev/bus/usb
ahu@intel:~$ ls -l /dev/bus/usb/
total 0
lrwxrwxrwx 1 root root 14 2007-05-26 21:58 devices -> .usbfs/devices
ahu@intel:~$ ls -l /dev/bus/usb/devices 
lrwxrwxrwx 1 root root 14 2007-05-26 21:58 /dev/bus/usb/devices ->
.usbfs/devices
ahu@intel:~$ wc -l /dev/bus/usb/devices
95 /dev/bus/usb/devices

On another machine (debian etch), with an older kernel, where lsusb does work:

open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3 fstat64(3, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0

fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 4 entries */, 4096)    = 96
close(3)                                = 0 
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 4 entries */, 4096)    = 96
getdents64(3, /* 0 entries */, 4096)    = 0 
close(3)                                = 0 
open("/dev/bus/usb/001", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=60, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 3 entries */, 4096)    = 72
open("/dev/bus/usb/001/001", O_RDWR)    = -1 EACCES (Permission denied)
open("/dev/bus/usb/001/001", O_RDONLY)  = 4

Any clues? Please let me know how I can help solve this problem!

Bert

Signature · 2 lines
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://netherlabs.nl              Open and Closed source services
#1 lore raw
Quoted 61 lines · bert hubert

Today I booted 2.6.22-rc2 on Ubunty Edgy Eft, and lsusb died on me:

ahu@intel:~$ lsusb
ahu@intel:~$ sudo lsusb
ahu@intel:~$ 

This behaviour persists in rc4. This might be udev related. I'm running:
ii udev 093-0ubuntu18.0edgy2

USB does work fine.

Bit from strace:

open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3 fstat64(3, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0

fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 4 entries */, 4096)    = 112
close(3)                                = 0
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 4 entries */, 4096)    = 112
getdents64(3, /* 0 entries */, 4096)    = 0
close(3)                                = 0

(end of program)

ahu@intel:~$ ls -l /dev/bus/usb -d
drwxr-xr-x 3 root root 80 2007-05-26 21:58 /dev/bus/usb
ahu@intel:~$ ls -l /dev/bus/usb/
total 0
lrwxrwxrwx 1 root root 14 2007-05-26 21:58 devices -> .usbfs/devices
ahu@intel:~$ ls -l /dev/bus/usb/devices 
lrwxrwxrwx 1 root root 14 2007-05-26 21:58 /dev/bus/usb/devices ->
.usbfs/devices
ahu@intel:~$ wc -l /dev/bus/usb/devices
95 /dev/bus/usb/devices

On another machine (debian etch), with an older kernel, where lsusb does work:

open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3 fstat64(3, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0

fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 4 entries */, 4096)    = 96
close(3)                                = 0 
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 4 entries */, 4096)    = 96
getdents64(3, /* 0 entries */, 4096)    = 0 
close(3)                                = 0 
open("/dev/bus/usb/001", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=60, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 3 entries */, 4096)    = 72
open("/dev/bus/usb/001/001", O_RDWR)    = -1 EACCES (Permission denied)
open("/dev/bus/usb/001/001", O_RDONLY)  = 4
Quoted 1 line

Any clues? Please let me know how I can help solve this problem!

It works fine for me here. Do you have CONFIG_USB_DEVICE_CLASS=y set?

Kay

#2 lore raw
Quoted 3 lines · Kay Sievers
Quoted 1 line

Any clues? Please let me know how I can help solve this problem!

It works fine for me here. Do you have CONFIG_USB_DEVICE_CLASS=y set?

Ah, I have not. However, this setting was not present in 2.6.21-rc3, from which configuration I ran 'make oldconfig'.

Make oldconfig does ask for this feature:
USB device class-devices (DEPRECATED) (USB_DEVICE_CLASS) [N/y/?] (NEW)

And I chose the default, breaking (my version of) lsusb, on Ubuntu Edgy Eft. I enabled USB_DEVICE_CLASS, and lsusb worked again.

Thank you both for your quick answers!

Please consider this patch which clarifies the need for USB_DEVICE_CLASS:

drivers/usb/core/Kconfig renamed from drivers/usb/core/Kconfig~ +2 -1
@@ -54,7 +54,8 @@
 	  device of the interface and therefore easily accessible from the interface
 	  event.
 
-	  This option provides backward compatibility if needed.
+	  This option provides backward compatibility and is required on
+	  many distributions to keep lsusb working.
 
 config USB_DYNAMIC_MINORS
 	bool "Dynamic USB minor allocation (EXPERIMENTAL)"
Signature · 2 lines
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://netherlabs.nl              Open and Closed source services
#3 lore raw
Quoted 21 lines · bert hubert
Quoted 3 lines · Kay Sievers
Quoted 1 line

Any clues? Please let me know how I can help solve this problem!

It works fine for me here. Do you have CONFIG_USB_DEVICE_CLASS=y set?

Ah, I have not. However, this setting was not present in 2.6.21-rc3, from which configuration I ran 'make oldconfig'.

Make oldconfig does ask for this feature:
USB device class-devices (DEPRECATED) (USB_DEVICE_CLASS) [N/y/?] (NEW)

And I chose the default, breaking (my version of) lsusb, on Ubuntu Edgy Eft. I enabled USB_DEVICE_CLASS, and lsusb worked again.

Thank you both for your quick answers!

Please consider this patch which clarifies the need for USB_DEVICE_CLASS:

drivers/usb/core/Kconfig line 58

Quoted 6 lines
drivers/usb/core/Kconfig renamed from drivers/usb/core/Kconfig~ +2 -1
@@ -54,7 +54,8 @@
 	  device of the interface and therefore easily accessible from the interface
 	  event.
 
-	  This option provides backward compatibility if needed.
+	  This option provides backward compatibility and is required on
+	  many distributions to keep lsusb working.

Yeah, a bit more text may be helpful. Many systems still use usbfs and should work just fine without that option. Adding a udev rule will also work.
The next version of HAL will depend on that udev rule. We have seen too many unpredictable event timing problems with the usb_device class, and will switch to the nodes provided directly by the usb-device instead of the separate class device. How does that help text sound?

This option provides backward compatibility for systems where usbfs is not mounted, and no udev rule like this exists:

    SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
      NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"

Thanks,
Kay

#4 lore raw
Quoted 6 lines

the separate class device. How does that help text sound?

This option provides backward compatibility for systems where usbfs is not mounted, and no udev rule like this exists:

    SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
      NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"

I'm mounting my Linus hat now, but the more I think about the insta-deprecation of USB_DEVICE_CLASS, and killing lsusb in even a very recent distribution release, I think this is an ABI or API change.

And we hate those.

So instead of papering this breakage over with cleverly worded help texts that suggest a solution, how about we set USB_DEVICE_CLASS to 'y' by default for a few more releases?

It would sure save a lot of lkml traffic on 'lsusb broke!'.

If this is unacceptable, please at least retain the word 'lsusb' somewhere in the help text, so people have at least the chance to spot their (current) need for USB_DEVICE_CLASS.

Perhaps:

"Some distributions need this feature for lsusb to work, unless the udev rule
above is configured".

Bert

Signature · 2 lines
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://netherlabs.nl              Open and Closed source services
#5 lore raw
Quoted 7 lines · bert hubert
Quoted 6 lines

the separate class device. How does that help text sound?

This option provides backward compatibility for systems where usbfs is not mounted, and no udev rule like this exists:

    SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
      NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
Quoted 5 lines

I'm mounting my Linus hat now, but the more I think about the insta-deprecation of USB_DEVICE_CLASS, and killing lsusb in even a very recent distribution release, I think this is an ABI or API change.

And we hate those.

There is no breakage at all. Nothing has changed regarding ABI/API. It's just a feature that is configurable now, that was always built-in in older kernels. That's all, and correctly configured kernels don't break anything.

Quoted 3 lines

So instead of papering this breakage over with cleverly worded help texts that suggest a solution, how about we set USB_DEVICE_CLASS to 'y' by default for a few more releases?

Makes sense, yes.

Quoted 10 lines

It would sure save a lot of lkml traffic on 'lsusb broke!'.

If this is unacceptable, please at least retain the word 'lsusb' somewhere in the help text, so people have at least the chance to spot their (current) need for USB_DEVICE_CLASS.

Perhaps:

"Some distributions need this feature for lsusb to work, unless the udev rule
above is configured".

It's libusb access in general and not specific to lsusb.

Kay

#6 lore raw
Quoted 8 lines · Kay Sievers

older kernels. That's all, and correctly configured kernels don't break anything.

Quoted 3 lines

So instead of papering this breakage over with cleverly worded help texts that suggest a solution, how about we set USB_DEVICE_CLASS to 'y' by default for a few more releases?

Makes sense, yes.

Good to hear - I also want my kernel to be configured correctly, of course, but I'm also happy if 'make oldconfig' keeps my correctly configured kernel, configured correctly.

So USB_DEVICE_CLASS='y' for a few more cycles is like music to my ears.

Quoted 4 lines
Quoted 2 lines

"Some distributions need this feature for lsusb to work, unless the udev rule
above is configured".

It's libusb access in general and not specific to lsusb.

"Some distributions need this feature for libusb-based applications (like
lsusb) to work, unless the udev rule above is configured"

The reason I stress lsusb so much is because for many operators, it is the first thing they do in case of USB problems 'is my device even there?'.

So it would be what people notice breaking - even though the underlying issue is with libusb.

Thanks!

Signature · 2 lines
http://www.PowerDNS.com      Open source, database driven DNS Software 
http://netherlabs.nl              Open and Closed source services
#7 lore raw
In reply to bert hubert
Quoted 39 lines · bert hubert

Greg, Kay, kernel people,

Today I booted 2.6.22-rc2 on Ubunty Edgy Eft, and lsusb died on me:

ahu@intel:~$ lsusb
ahu@intel:~$ sudo lsusb
ahu@intel:~$ 

This behaviour persists in rc4. This might be udev related. I'm running:
ii udev 093-0ubuntu18.0edgy2

USB does work fine.

Bit from strace:

open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3 fstat64(3, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0

fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 4 entries */, 4096)    = 112
close(3)                                = 0
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 4 entries */, 4096)    = 112
getdents64(3, /* 0 entries */, 4096)    = 0
close(3)                                = 0

(end of program)

ahu@intel:~$ ls -l /dev/bus/usb -d
drwxr-xr-x 3 root root 80 2007-05-26 21:58 /dev/bus/usb
ahu@intel:~$ ls -l /dev/bus/usb/
total 0
lrwxrwxrwx 1 root root 14 2007-05-26 21:58 devices -> .usbfs/devices
ahu@intel:~$ ls -l /dev/bus/usb/devices 
lrwxrwxrwx 1 root root 14 2007-05-26 21:58 /dev/bus/usb/devices ->
.usbfs/devices
Quoted 5 lines
ahu@intel:~$ wc -l /dev/bus/usb/devices
95 /dev/bus/usb/devices

On another machine (debian etch), with an older kernel, where lsusb does work:

What is that kernel version?

This works fine for me here too...

thanks,

greg k-h