On Thu, 1 Jul 2004, Luca Risolia wrote:

> The patch works for me. Now I can remove the ugly 
> wait_for_completion/complete mechanism that I used to avoid
> race conditions during disconnections. 

Good.  That's exactly the sort of thing it was intended for.

> It's worth to note that a number of drivers under usb/media/
> still implement "simple" urb removal (urb_unlink()+free_urb())
> without the above mechanism and proper error handling.
> Although this is not a problem in most of the cases, it is likely
> that they crash the kernel on SMP machines.

usb_unlink_urb() followed immediately by usb_free_urb() is correct, even 
if the unlink is asynchronous.  Reference counting of URBs guarantees that 
the URB won't be deallocated until the completion handler has finished 
running and the URB is idle.

Alan Stern



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to