David:

The recent change you made to the irq handling in hcd_endpoint_disable() 
caused a problem.  The statement

        local_irq_save (flags);

needs to be outside the rescan loop.  Otherwise, on loop iterations after 
the first, flags is always set to indicate that interrupts are disabled.

In fact, since the routine ends with might_sleep() anyway, I don't see any
reason to save the interrupt state at all.  My patch just disables
interrupts at the start and enables them at the end.  I'm not sure that's
how you intended it to work, so you may want to change it a little.

Alan Stern


===== hcd.c 1.111 vs edited =====
--- 1.111/drivers/usb/core/hcd.c        Tue Jul 15 12:47:16 2003
+++ edited/drivers/usb/core/hcd.c       Mon Jul 21 09:43:30 2003
@@ -1273,7 +1273,6 @@
  */
 static void hcd_endpoint_disable (struct usb_device *udev, int endpoint)
 {
-       unsigned long   flags;
        struct hcd_dev  *dev;
        struct usb_hcd  *hcd;
        struct urb      *urb;
@@ -1282,6 +1281,8 @@
        dev = udev->hcpriv;
        hcd = udev->bus->hcpriv;
 
+       local_irq_disable ();
+
 rescan:
        /* (re)block new requests, as best we can */
        if (endpoint & USB_DIR_IN) {
@@ -1293,7 +1294,6 @@
        }
 
        /* then kill any current requests */
-       local_irq_save (flags);
        spin_lock (&hcd_data_lock);
        list_for_each_entry (urb, &dev->urb_list, urb_list) {
                int     tmp = urb->pipe;
@@ -1342,7 +1342,7 @@
                goto rescan;
        }
        spin_unlock (&hcd_data_lock);
-       local_irq_restore (flags);
+       local_irq_enable ();
 
        /* synchronize with the hardware, so old configuration state
         * clears out immediately (and will be freed).



-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to