This patch fixes a bug reported by Greg and David, as well as some other
people recently.

uhci.c would call wait_ms, which can sleep, with spinlocks held. There
are two places where this happens, but only one was the cause of the
problem.

Greg, please apply to 2.4 and 2.5. Thanks!

JE

--- linux-2.4.19-pre6.orig/drivers/usb/uhci.c   Sun Apr  7 13:22:10 2002
+++ linux-2.4.19-pre6/drivers/usb/uhci.c        Sun Apr  7 13:25:27 2002
@@ -1811,6 +1811,9 @@
                } else {
                        urb->status = -ENOENT;
 
+                       spin_unlock(&urb->lock);
+                       spin_unlock_irqrestore(&uhci->urb_list_lock, flags);
+
                        if (in_interrupt()) {   /* wait at least 1 frame */
                                static int errorcount = 10;
 
@@ -1820,9 +1823,6 @@
                        } else
                                schedule_timeout(1+1*HZ/1000); 
 
-                       spin_unlock(&urb->lock);
-                       spin_unlock_irqrestore(&uhci->urb_list_lock, flags);
-
                        uhci_call_completion(urb);
                }
        }
@@ -2193,12 +2193,12 @@
                        OK(0);
                case RH_PORT_RESET:
                        SET_RH_PORTSTAT(USBPORTSC_PR);
-                       wait_ms(50);    /* USB v1.1 7.1.7.3 */
+                       mdelay(50);     /* USB v1.1 7.1.7.3 */
                        uhci->rh.c_p_r[wIndex - 1] = 1;
                        CLR_RH_PORTSTAT(USBPORTSC_PR);
                        udelay(10);
                        SET_RH_PORTSTAT(USBPORTSC_PE);
-                       wait_ms(10);
+                       mdelay(10);
                        SET_RH_PORTSTAT(0xa);
                        OK(0);
                case RH_PORT_POWER:

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to