Re: [RFC] usbfs2 aio cancellation code

David Brownell <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <20071002192339.3FB1E214A9C@adsl-69-226-248-13.dsl.pltn13.pacbell.net>
> > Hmm.  If usb_unlink_urb() returns 0 then operation is still in  
> > flight, right?
>
> No.  usb_unlink_urb() is weird; it returns -EINPROGRESS to indicate
> success.  Don't ask me why.  Presumably that will be fixed eventually.

The "why" is easy:  that's how it used to distinguish sync vs async
call modes, back when they were glommed into one call rather than
being split out into distinct unlink() and kill() procedures.  And
that didn't get changed when kill() was introduced.


> But even when usb_unlink_urb() succeeds, it doesn't mean that the URB
> is still in flight when the function call returns.  The URB may have
> already completed.  And conversely, when usb_unlink_urb() fails, it
> doesn't mean the URB has completed yet.

Right.  Consider the SMP case:  one CPU says "unlink", and while
that CPU is returning from that request the other one issues the
requested completion.  Or consider those HCDs which have at least
a few cases in which "unlink" is synchronous.

The typical case will be that the completion returns after unlink(),
but that is far from the only case.



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.