On Tue, 13 Jul 2004, Jesse Stockall wrote:

> Log is attached
> 
> > Did lsusb hang immediately after booting?  What drivers and USB 
> > devices had been loaded?
> > 
> 
> System boots. X is started. Login on VT1. Run lsusb. See attachment for
> modules loaded. Mouse and on-board hub are only devices.
> 
> > What would happen if instead of running lsusb you tried to cat 
> > /proc/bus/usb/devices?
> > 
> 
> Hangs, same as lsusb. The following line appears in dmesg after I ran
> 'cat /proc/bus/usb/devices'
> 
> usb_lock_device: udev=f7fd2800 count=fffefffe
> 
> > Was some earlier process (like a modprobe) already hung when these other 
> > problems occurred?
> > 
> 
> No, all modules are loaded, and hotplug / udev have finished. Mouse
> works fine in X
> 
> Jesse

A very informative and detailed response, thank you.

The problem shows up clearly in your "dmesg" file; something is calling 
usb_unlock_device() without calling usb_lock_device() first.  
Unfortunately the diagnostic patch didn't include a dump_stack() call in 
usb_unlock_device(), so I can't tell who the guilty party is.

Here's a shorter patch for you to try.  It ought to pinpoint the culprit.  
This is probably some stupid mistake on my part that will end up being
obvious, but I just can't see where it is...

Alan Stern



===== drivers/usb/core/usb.c 1.281 vs edited =====
--- 1.281/drivers/usb/core/usb.c        Wed Jun 30 09:44:26 2004
+++ edited/drivers/usb/core/usb.c       Wed Jul  7 14:04:02 2004
@@ -891,6 +854,9 @@
  */
 void usb_lock_device(struct usb_device *udev)
 {
+       printk(KERN_INFO "%s: udev=%p count=%lx\n", __FUNCTION__, udev,
+                       usb_all_devices_rwsem.count);
+       dump_stack();
        down_read(&usb_all_devices_rwsem);
        down(&udev->serialize);
 }
@@ -968,6 +934,9 @@
  */
 void usb_unlock_device(struct usb_device *udev)
 {
+       printk(KERN_INFO "%s: udev=%p count=%lx\n", __FUNCTION__, udev,
+                       usb_all_devices_rwsem.count);
+       dump_stack();
        up(&udev->serialize);
        up_read(&usb_all_devices_rwsem);
 }



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to