Hello,
On Saturday 06 March 2004 01:16, David Brownell wrote:
If an URB terminates with an error, its queue is stopped until the URB's completion handler returns. Note that an IN transfer ending early because a short packet was received counts as an error if and only if the URB_SHORT_NOT_OK flag is set.
Right. Stopping is important because otherwise one data block could be written where another one belongs, and only the device driver (not HCD!) can tell if continuing risks thay or not ... it will often unlink all urbs later in the queue, and the hardware must not start them in that case.
How would I unlink all urbs from the completion handler? If I do it synchronous, I'll have to sleep in the completion handler.
The kernel doc does point out explicitly that you can't use synchronous unlinking from a completion handler.
If I do it asynchronous, flow of execution will return from the completion handler (and therefore reenabling the queue) before the following urbs in the queue are really unlinked??
If the queue has been stopped (because of fault) then the unlinks should happen before re-enabling the queue.
Can this actually happen?
Yes. Preventing that "write the wrong data block" scenario means the queue must stop until all faults are cleaned up, both hardware (errors halt the queue) and software (unlinks do it, "software-initiated errors").
- Dave
------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
