On Wed, Jul 22, 2009 at 10:43:07AM +0530, Viral Mehta wrote: > > > Sarah Sharp wrote: >> When an endpoint on a device under an xHCI host controller stalls, the >> host controller driver must let the hardware know that the USB core has >> successfully cleared the halt condition. The HCD submits a Reset Endpoint >> Command, which will clear the toggle bit for USB 2.0 devices, and set the >> sequence number to zero for USB 3.0 devices. >> >> The xHCI urb_enqueue will accept new URBs while the endpoint is halted, >> and will queue them to the hardware rings. > Just out of curiosity, > Is there any possibility of hardware ring overflow and thus loss of > data, while endpoint is halted ? > This could be irrelevant but I was not able to get anything by looking > at the source. Yes, the hardware ring could fill up if the endpoint was halted and the driver kept submitting URBs. There is a check in prepare_ring() to make sure that there's room on the ring. If not, the submit_urb() function will fail with -ENOMEM. In reality, the driver will clear the halt immediately, which will start the process of resetting the endpoint for the xHCI host controller. The driver might submit one URB before the hardware responds to the reset endpoint command. I suppose you might run out of room if that was a very large bulk transfer, but it's unlikely. Eventually I'd like to expand the endpoint rings on demand when they're starting to fill up. That's rather complicated, and will effect a lot of ring code. Sarah Sharp -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html