Axel Waggershauser wrote:

That recognized, I got the ingenious idea to check the return value of
the unlink call... It returns -EBUSY (-16). So it looks to me like the
controller driver sort of "got stuck" with this urb.

I generally encourage drivers to use async unlink if they're using the async submit call. In any case, EBUSY doesn't mean "stuck"; it just means that the urb is already being given back, but it's not yet completed (and won't overwrite that status with "canceled").


Can I generally expect that the controller cancels the urb by itself
when the device gets disconnected (like it does on the other machine)?

As Alan said, it's the hub driver doing that (part of usbcore).


And what's happening is that the endpoint is getting disabled,
which first cancels all pending urbs and then (except for UHCI!)
waits for the urbs to all complete.

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.


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.

If you're doing that, then just treat -EBUSY as a success condition,
just like 0; and synchronize later with the request completion.

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).

- Dave




------------------------------------------------------- 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

Reply via email to