On Mon, 23 Feb 2004, Stephen Hemminger wrote: > Great, the kernel with this patch ran successfully all weekend. Looks like no > more races in the unlink path.
Wonderful. Thanks a lot for all your SMP testing, it's been a big help. Greg, This patch corrects an error in the dequeueing code for UHCI. Improper locking caused it to hang in the oddball case where an URB was unlinked even before it had been queued. Please apply. Alan Stern ===== uhci-hcd.c 1.89 vs edited ===== --- 1.89/drivers/usb/host/uhci-hcd.c Thu Feb 19 18:30:19 2004 +++ edited/drivers/usb/host/uhci-hcd.c Fri Feb 20 15:04:41 2004 @@ -1508,12 +1508,9 @@ struct urb_priv *urbp = urb->hcpriv; list_del_init(&urbp->urb_list); - spin_unlock_irqrestore(&uhci->urb_list_lock, flags); - uhci_destroy_urb_priv (uhci, urb); - - return ret; - } - ret = 0; + uhci_destroy_urb_priv(uhci, urb); + } else + ret = 0; out: spin_unlock_irqrestore(&uhci->urb_list_lock, flags); @@ -1649,10 +1646,12 @@ { struct uhci_hcd *uhci = hcd_to_uhci(hcd); unsigned long flags; - struct urb_priv *urbp = urb->hcpriv; + struct urb_priv *urbp; spin_lock_irqsave(&uhci->urb_list_lock, flags); - + urbp = urb->hcpriv; + if (!urbp) /* URB was never linked! */ + goto done; list_del_init(&urbp->urb_list); uhci_unlink_generic(uhci, urb); @@ -1665,6 +1664,7 @@ list_add_tail(&urbp->urb_list, &uhci->urb_remove_list); spin_unlock(&uhci->urb_remove_list_lock); +done: spin_unlock_irqrestore(&uhci->urb_list_lock, flags); return 0; } ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel