On Fri, 15 May 2009, David Brownell wrote: > On Friday 15 May 2009, Alan Stern wrote: > > Dave B.: The patch makes a few significant changes. Most notably, the > > code for clearing the TT buffer no longer depends on QTD_STS_HALT, and > > unlinked URBs no longer cause an early return. It also doesn't depend > > on status != -EPIPE; that seemed like an unnecessary optimization. > > It's more careful to run only for async endpoints (the old code only > > checked for !Interrupt). Last but not least, the test for QTD_STS_MMF > > is changed to QTD_STS_STS -- the MMF value must have been a typo since > > it applies only to periodic endpoints. > > And that MMF thing may explain why there have been persistent > issues with that "clear the tt buffer" code. :) > > Patch looks reasonable; do we have testing results yet? I tried it out. It does appear to work; I'm now getting Clear-TT-Buffer requests that never used to be generated. And they are even generated at the right times! :-) One aspect isn't entirely clear. The original code checked for status != -EPIPE with no explanation. In my testing, it turned out that when a STALL was received the QTD_STS_STS bit _was_ set -- even though in principle it shouldn't have been. Apparently the hardware doesn't bother to clear it when a STALL arrives. (This was with an Intel controller; I haven't yet tried other types.) Now, in 11.17.5 the USB spec says that the Clear-TT-Buffer request must be used as part of endpoint halt processing. This would seem to imply that we should send it whenever we see -EPIPE, even if QTD_STS_STS isn't set! So what should the code do? Be safe and always send Clear-TT-Buffer if status == -EPIPE? Alan Stern -- 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