On Wed, 12 Oct 2005, David Brownell wrote:

> Potentially; the usb_get_urb() and atomic_inc() should be paired with the
> list_add_tail() -- under spinlock protection -- rather than being done as
> late as it's now done by hcd_submit_urb().  That's what Alan's patch does.
> 
> Similarly, the urb->*_dma fields should be set up before list_add_tail(),
> at least for urbs not going to the root hub.  Of course that won't matter
> for non-DMA HCDs like sl811.
> 
> Root hub urbs could stand a closer look; now that they have a real
> queue, usbcore shouldn't need to use an hcd->status_urb any more.
> (Limiting them to single entry queues ...)
> 
> The sl811 code should probably refuse to start() urbs it hasn't marked
> yet (by setting urb->hcpriv) too.  There's no point to maintaining a
> parallel queue for each endpoint, but it should still ignore URBs that
> haven't yet been set up both by usbcore and by the HCD.  And setting
> hcpriv is what marks the URB as having been set up by that HCD.

If every HCD is careful not to use URBs that aren't marked (i.e., for
which urb->hcpriv is NULL), then a single endpoint queue would be okay.  
And it wouldn't be necessary to move the usb_get_urb and atomic_inc 
statements either (or the DMA stuff).

We will still have the problem that the HCDs don't have access to the 
spinlock that protects the queue pointers.  I suppose the spinlock could 
be EXPORTed.

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
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