Re: limits of usb_kill_urb()

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Thu, 15 Mar 2007, Oliver Neukum wrote:

> Hi,
> 
> I am looking at code in which an interrupt completion handler can either
> 
> a) resubmit itself
> b) submit a control URB
> 
> the control URB will in turn submit the interrupt URB again.
> 
> It seems to me that usb_kill_urb() alone cannot be used to cancel IO
> without a race condition, as the following race always exists.

Yes, certainly.  usb_kill_urb() handles only the common case.

> This problem exists if more than two URBs are involved, too. If you take
> completion as nodes in a directed graph and submissions as edges, you
> need to watch for cycles.
> 
> Comments? Should I add a warning to Documentation/URB.txt?

It wouldn't be a bad idea to do so.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
[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.