On Fri, May 10, 2002 at 07:00:08PM +0200, Eduard Hasenleithner wrote:
> Hello again!
> 
> As mentioned on the -users list I have a problem with
> my sl11r USB/IDE adapter + harddisk. The initial
> messages when connecting are:
> 
> May 10 18:04:43 editower kernel: hub.c: USB new device connect on bus2/2, assigned 
>device number 2
> May 10 18:04:43 editower kernel: usb-uhci.c: interrupt, status 2, frame# 54
> May 10 18:04:43 editower kernel: usb.c: USB device not accepting new address=2 
>(error=-110)
> May 10 18:04:44 editower kernel: hub.c: USB new device connect on bus2/2, assigned 
>device number 3
> May 10 18:04:44 editower kernel: usb.c: USB device not accepting new address=3 
>(error=-110)
> 
> But when unloading and reloading the chipset driver
> (usb-uhci) the device is recorgnised properly. This

The usual problem, I have found similar behavior with other devices. But the
delay-patch fixes only a small part of all occurrences. A long time ago, I
proposed an change to the usb_new_device()-procedure, which retries setting
the ID and the getting the descriptor if something fails. So its behavior is
more forgiving and ehh... Windows-like :-)

I have attached the (old) patch, it maybe needs some adjustment for 2.4.19
or 2.5, but I suggest that it should be included. Some devices (e.g. a
USB-audio adaptor with a Philips chip or early bluetooth interfaces) won't
work without it. Since it doesn't touch the timing for working devices, it
should be pretty safe...

-- 
         Georg Acher, [EMAIL PROTECTED]         
         http://www.in.tum.de/~acher/
          "Oh no, not again !" The bowl of petunias          
diff -u linux/drivers/usb/usb.c linux.afs/drivers/usb/usb.c
--- linux/drivers/usb/usb.c     Tue Aug  7 10:48:27 2001
+++ linux.afs/drivers/usb/usb.c Wed Aug 29 16:55:26 2001
@@ -2169,6 +2169,7 @@
 int usb_new_device(struct usb_device *dev)
 {
        int err;
+       int n,m;
 
        /* USB v1.1 5.5.3 */
        /* We read the first 8 bytes from the device descriptor to get to */
@@ -2177,18 +2178,31 @@
        dev->epmaxpacketin [0] = 8;
        dev->epmaxpacketout[0] = 8;
 
-       err = usb_set_address(dev);
-       if (err < 0) {
-               err("USB device not accepting new address=%d (error=%d)",
-                       dev->devnum, err);
-               clear_bit(dev->devnum, &dev->bus->devmap.devicemap);
-               dev->devnum = -1;
-               return 1;
-       }
+       for(m=0;m<2;m++) {
+               
+               for(n=0;n<2;n++) {                      
+                       err = usb_set_address(dev);
+                       if (err>=0)
+                               break;
+                       wait_ms(200);
+               }
+               
+               if (err < 0) {
+                       err("USB device not accepting new address=%d (error=%d)",
+                           dev->devnum, err);
+                       clear_bit(dev->devnum, &dev->bus->devmap.devicemap);
+                       dev->devnum = -1;
+                       return 1;
+               }
 
-       wait_ms(10);    /* Let the SET_ADDRESS settle */
+               wait_ms(10);    /* Let the SET_ADDRESS settle */
 
-       err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, &dev->descriptor, 8);
+               err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, &dev->descriptor, 8);
+               if (err >= 8) 
+                       break;
+               wait_ms(100);
+       }
+       
        if (err < 8) {
                if (err < 0)
                        err("USB device not responding, giving up (error=%d)", err);
@@ -2198,6 +2212,7 @@
                dev->devnum = -1;
                return 1;
        }
+
        dev->epmaxpacketin [0] = dev->descriptor.bMaxPacketSize0;
        dev->epmaxpacketout[0] = dev->descriptor.bMaxPacketSize0;
 

Reply via email to