Re: anchors and their use

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

> Am Mittwoch, 16. Mai 2007 17:30 schrieb Alan Stern:
> 
> > This won't build because you forgot to export usb_unanchor_urb().
> > 
> > You could make usb_init_anchor() non-inline.  I'm not sure where 
> > tradeoff lies, but you might be over the limit.
> > 
> > I don't like the way you combined the error handling in usb-skeleton 
> > with the anchor stuff.  Better to keep the two things in separate 
> > patches.
> 
> Hi,
> 
> I hope this version addresses your concerns

Very good.  I did notice two more things:

	Timeouts are specified in jiffies, so your timeout argument
	should be long or unsigned long, not int.

	There's a race if two threads call usb_unanchor_urb() for the
	same URB at the same time.  You need to recheck while holding 
	the anchor's spinlock that urb->anchor is still equal to 
	anchor.  You might also want to add

		WARN_ON(urb->anchor != NULL);

	to usb_anchor_urb(), just as a precaution.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[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.