ChangeSet 1.1595.8.9, 2003/07/30 10:36:26-07:00, stern@rowland.harvard.edu [PATCH] USB: Fix irq problem in hcd_endpoint_disable() The recent change 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. drivers/usb/core/hcd.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff -Nru a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c --- a/drivers/usb/core/hcd.c Fri Aug 1 10:56:13 2003 +++ b/drivers/usb/core/hcd.c Fri Aug 1 10:56:13 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).