On Tue, 8 May 2007, David Brownell wrote:

> 
> > > It's probably nothing, but this line in ohci-q.c in td_submit_urb raised
> > > an eyebrow:
> > > 
> > > urb_priv->ed->hwHeadP &= ~cpu_to_hc32 (ohci, ED_C);
> > > 
> > > There is a comment "resetting toggle is meaningless if the endpoint is
> > > active" above this code. While that's true, I wouldn't expect this
> > > operation to be atomic. What happens if the HC is updating headP during
> > > this block? 
> 
> It's not allowed to be active at that point.  The flag being
> tested is set only by usb_clear_halt()

More accurately, the flag being tested (i.e., the toggle value) is 
_cleared_ only by usb_clear_halt() and usb_enable_endpoint().  ohci-hcd 
sets the toggle in the next line, and it remains set until the endpoint is 
cleared or re-enabled.

> ... for OHCI and any
> other HCD managing toggle in hardware, the software flag which
> must have been set before that condition triggers (and that
> statement executes) is only used to say "reset this endpoint's
> toggle, whatever it may be".

Got it.  Thank you.

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/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to