Ted Phelps may have said:
> Duncan Sands may have said:
> > It has nothing to do with synchronous vs asynchronous unlinking!
> > Indeed these urbs are supposed to be unlinked synchronously.
> 
> > Could you please check if
> >     usb_unlink_urb(as->urb);
> > returns a non-zero error code?
> 
> I will do so this evening.

Good call!  It's returning -16 (-EBUSY) which, according to the
comment in hcd_unlink_urb means that something else is in the middle
of unlinking the URB.  I've created a new patch (see below) which also
clears up my problem, but if you'd like to address this issue in
another way I'm happy to apply other patches :-)

Thanks!
-Ted

--- linux-2.6.0-test8/drivers/usb/core/devio.c  2003-11-03 21:28:38.000000000 +0000
+++ linux-2.6.0-test9/drivers/usb/core/devio.c  2003-11-03 21:28:15.000000000 +0000
@@ -275,6 +275,7 @@
 {
        struct async *as;
        unsigned long flags;
+       int ret;
 
        spin_lock_irqsave(&ps->lock, flags);
        while (!list_empty(list)) {
@@ -282,7 +283,8 @@
                list_del_init(&as->asynclist);
                spin_unlock_irqrestore(&ps->lock, flags);
                 /* usb_unlink_urb calls the completion handler with status == -ENOENT 
*/
-               usb_unlink_urb(as->urb);
+               while ((ret = usb_unlink_urb(as->urb)) == -EBUSY)
+                       schedule();
                spin_lock_irqsave(&ps->lock, flags);
        }
        spin_unlock_irqrestore(&ps->lock, flags);


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to