> It would still be a good idea to give drivers an easy way to wait for an
> URB to be completely idle (i.e., completion handler not running and URB
> not currently linked) without making them do careful locking and
Absolutely. That's what people want when they do a synchronous unlink.
> synchronization themselves. To do so would require the core to be able to
> tell, after the completion handler returns, whether the URB has been
> resubmitted. Currently I don't think there is any way to do this.
It is doable with a flag. Set it in usb_submit_urb() and reset
it in usb_urb_giveback_urb(). As we have established usb_urb_giveback_urb()
cannot be reentered, so I see no race in checking that flag after the
completion handler.
The code have already proposed should in essence be up to it.
> > Hm, I am unsure.
> > Couldn't we eliminate most uses of usb_unlink_urb() from 2.6 anyway?
>
> A lot of them, probably yes. However there must be cases where drivers
> want to unlink an URB because of a timeout rather than disconnection.
> usb-storage does that, but it always uses async unlinking.
In the network drivers. But they also use asynchronous unlink iirc.
Regards
Oliver
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel