2007-05-26 20:49:24

by bert hubert

[permalink] [raw]
Subject: udev regression? lsusb silent (no output) since 2.6.22-rc2 at least

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

--
http://www.PowerDNS.com Open source, database driven DNS Software
http://netherlabs.nl Open and Closed source services


2007-05-27 02:43:50

by Kay Sievers

[permalink] [raw]
Subject: Re: udev regression? lsusb silent (no output) since 2.6.22-rc2 at least

On Sat, 2007-05-26 at 22:18 +0200, bert hubert wrote:
> 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!

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

Kay

2007-05-27 05:36:18

by Greg KH

[permalink] [raw]
Subject: Re: udev regression? lsusb silent (no output) since 2.6.22-rc2 at least

On Sat, May 26, 2007 at 10:18:54PM +0200, bert hubert wrote:
> 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:

What is that kernel version?

This works fine for me here too...

thanks,

greg k-h

2007-05-27 09:25:54

by bert hubert

[permalink] [raw]
Subject: Re: udev regression? lsusb silent (no output) since 2.6.22-rc2 at least

On Sun, May 27, 2007 at 04:42:35AM +0200, Kay Sievers wrote:
> > 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~ 2007-05-27 11:22:22.000000000 +0200
+++ ./drivers/usb/core/Kconfig 2007-05-27 11:22:22.000000000 +0200
@@ -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)"

--
http://www.PowerDNS.com Open source, database driven DNS Software
http://netherlabs.nl Open and Closed source services

2007-05-27 14:11:12

by Kay Sievers

[permalink] [raw]
Subject: Re: udev regression? lsusb silent (no output) since 2.6.22-rc2 at least

On Sun, 2007-05-27 at 11:25 +0200, bert hubert wrote:
> On Sun, May 27, 2007 at 04:42:35AM +0200, Kay Sievers wrote:
> > > 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~ 2007-05-27 11:22:22.000000000 +0200
> +++ ./drivers/usb/core/Kconfig 2007-05-27 11:22:22.000000000 +0200
> @@ -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

2007-05-27 14:20:27

by bert hubert

[permalink] [raw]
Subject: Re: udev regression? lsusb silent (no output) since 2.6.22-rc2 at least

> 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

--
http://www.PowerDNS.com Open source, database driven DNS Software
http://netherlabs.nl Open and Closed source services

2007-05-27 14:35:44

by Kay Sievers

[permalink] [raw]
Subject: Re: udev regression? lsusb silent (no output) since 2.6.22-rc2 at least

On Sun, 2007-05-27 at 16:20 +0200, bert hubert wrote:
> > 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.

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.

> 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.

> 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

2007-05-27 14:40:21

by bert hubert

[permalink] [raw]
Subject: Re: udev regression? lsusb silent (no output) since 2.6.22-rc2 at least

On Sun, May 27, 2007 at 04:34:37PM +0200, Kay Sievers wrote:
> older kernels. That's all, and correctly configured kernels don't break
> anything.
>
> > 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.

> > "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!

--
http://www.PowerDNS.com Open source, database driven DNS Software
http://netherlabs.nl Open and Closed source services