Alan Stern wrote:
Furthermore, there is a conceptual problem that has not been fully addressed. When a usb_unlink_urb() is called for an URB whose completion handler is running, which incarnation are we being asked to cancel? The one that just completed or the one that the completion handler is about to submit? If you can't answer this question first, then naturally you don't know what you're supposed to do.
For drivers that resubmit, we already know they need to synch on whether resubmit should happen. Doing that _always_ resolves that question with respect to the driver.
The kerneldoc says usb_unlink_urb "cancels an in-progress request", which was intended to resolve that question in terms of states that HCDs see. In terms of the hcd framework: it's in-progress so long as the urb is (a) on the device's urb_list, and also (b) still active. That is, "submitted, but not yet completed".
As for the synchronous unlink case, I wrote it that way becauseAs far as guaranteeing that when usb_unlink_urb() returns from a synchronous unlink, the completion handler will have already finished -- so far as I can tell there is currently no such guarantee. At least, the kerneldoc preceding usb_unlink_urb() is sufficiently vague that it doesn't make this promise. Of course, we need to have something like this.
of the non-"hcd" drivers out there, which may not be doing that;
it's not an easily testable API requirement (on smp).
But I agree this guarantee is worth providing (it's why the "hcd"
code chose that solution) so I'll update the doc.
- Dave
-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving your online business a competitive advantage. Test-drive a Thawte SSL certificate - our easy online guide will show you how. Click here to get started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel