Index: orinoco_usb.c =================================================================== RCS file: /usr/local/cvsroot/ranty/orinoco/driver/orinoco_usb.c,v retrieving revision 1.85 diff -u -r1.85 orinoco_usb.c --- orinoco_usb.c 1 Jul 2003 23:52:11 -0000 1.85 +++ orinoco_usb.c 2 Jul 2003 10:00:50 -0000 @@ -400,7 +400,7 @@ netif_wake_queue(net_dev); break; } - complete(&ctx->done); + complete_all(&ctx->done); bridge_request_context_put(ctx); break; @@ -410,7 +410,7 @@ /* This is normal, as all request contexts get flushed * when the device is disconnected */ err("Called, CTLX not terminating, but device gone"); - complete(&ctx->done); + complete_all(&ctx->done); bridge_request_context_put(ctx); break; } @@ -1881,13 +1881,9 @@ dev->udev = NULL; //priv->hw_unavailable = 1; - if(dev->read.urb->status == -EINPROGRESS){ - warn("%s: Unlinking pending IN urb", __FUNCTION__); - retval = bridge_remove_in_urb(dev); - if(retval){ - dbg("retval %d status %d", retval, - dev->read.urb->status); - } + retval = bridge_remove_in_urb(dev); + if (retval) { + dbg("retval %d status %d", retval, dev->read.urb->status); } restart_list: spin_lock_irqsave(&dev->ctxq.lock, flags); @@ -1899,8 +1895,10 @@ spin_unlock_irqrestore(&dev->ctxq.lock, flags); /* We don't like racing :) */ - ctx->outurb->transfer_flags &= ~URB_ASYNC_UNLINK; - usb_unlink_urb(ctx->outurb); + if (ctx->outurb->status == -EINPROGRESS) { + usb_unlink_urb(ctx->outurb); + wait_for_completion(&ctx->done); + } del_timer_sync(&ctx->timer); if (!list_empty(&ctx->list))