On Tue, 2004-01-13 at 03:14, David Brownell wrote: > Somewhere there's a patch floating around which makes UHCI wait > for those URBs to complete too. Lacking that patch, you need to > do what all robust USB drivers have always done: wait for all > their urbs to complete.
Should I wait with a timeout or forever? > > What am i supposed to do if the usb_unlink_urb call returns -EBUSY? > > Think about the problem a bit differently: you should synchronize on > the completion of the URB, not on the return from cancel/unlink. > In fact, don't use the synchronous unlink calls -- they've always > had issues, the async unlink has always been more portable. OK, I have no problem with changing that aspect to get a more robust driver, but I can't see how this helps in this particular situation. As I understand it (from what Alan said), the URB gets unlinked in hcd_endpoint_disable() and this happens the moment I unplug the device. Then about 3 seconds later my wait_event call, waiting for the URB completion, times out. By that time, the URB should be long gone. And then I try to unlink the URB because from the drivers point of view, it could just be valid timeout, due to a device malfunctioning. If I call unlink_urb asynchronously and wait for the completion again, I would expect that wait never to return. Or is the URB_ASYNC_UNLINK flag itself the key to the problem? > Or you can probably just wait a couple milliseconds. Assuming that > your completion functions keep a record of which urbs are still > pending, it won't be on that list any longer -- unless there's a bug > (likely in UHCI at that point). I don't quite understand what you try to tell me here. In my case I have exactly one URB and I wait for this very one but still 3 seconds after the unplug event, it is not completed. So there is a bug in the underling core/controller code that has nothing to do with my synchronization, right? Thanks, Axel. ------------------------------------------------------- This SF.net email is sponsored by: Perforce Software. Perforce is the Fast Software Configuration Management System offering advanced branching capabilities and atomic changes on 50+ platforms. Free Eval! http://www.perforce.com/perforce/loadprog.html _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel