Thanks for your help, Mathias! See my comments inline below: Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx> wrote on 04/08/2014 10:26:43 AM: > The issue we currently have is that the xHCI (both driver and hw) > refuses to reset an endpoint if it's not halted. > SetFeature(ENDPOINT_HALT) will set the device to halted state, but it > requires some additional transfer that returns STALL until xHCI will see > the endpoint as halted. > > So in this case the situation is: > Abort pending urbs > SetFeature(ENDPOINT_HALT) > - ep halted on device side, xHCI doesn't consider ep halted. > usb_clear_halt() > - ClearFeature(ENDPOINT_HALT) -> device resets its ep toggle/sequence > - call hcd->driver->endpoint_reset(), but the xhci .endpoint_reset() > callback can't reset an endpoint it doesn't consider halted. > xhci host side toggle/sequence are not reset -> mismatch. Ok. But there shouldn't be any way user code should be able to get the two out-of-sync, right? This is really a layer below what the user should be able to interact with. Maybe this is what you are saying? > With dynamic debugging enabled for xhci you should probably see: > "Endpoint x not halted, refusing to reset." I'll try to get a kernel installed with this enabled. Right now it is a bit tricky to update kernels on our systems because their are a whole hierarchy of dependencies that need to rebuild with it. If there are specific things to test that I can lump together I can rebuild it all at once. > Discussion threads touching this topic: > http://marc.info/?l=linux-usb&m=134922286125585&w=2 > http://marc.info/?l=linux-usb&m=134852269014614&w=2 > http://marc.info/?l=linux-usb&m=139025060301432&w=2 Thanks for consolidating those messages. Those were the ones I had seen previously but wasn't sure what to conclude. > I'm focusing on this issue right now, and I appreciate if you are able > to run some test with your setup once I get something ready. Great! I can help as needed. > The main thing that needs to be done is what xHCI specs states > in an additional Note added to section 4.6.8 : > " If software wishes reset the Data Toggle or Sequence Number of an > endpoint that isn't in the Halted state, then software may issue a > Configure Endpoint Command with the Drop and Add bits set for the > target endpoint." But some other tweaking to how xhci driver handles > STALL and clears halted endpoints is also needed. Since the bus trace looks the same on Windows as on Linux (minues the incorrect sequence number and the failure), I assume this must be how it is done there? Eric Gross -- 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