On 21.8.2020 20.01, Alan Stern wrote: > On Fri, Aug 21, 2020 at 06:34:55PM +0200, Martin Thierer wrote: >> I read the usb 2.0 specs and generally came to the same conclusion, >> except I wasn't 100% sure because 9.1.1.5 talks about "configuring" in >> the context of bringing a device into the "configured" state, which >> one could argue isn't really the case if a "set configuration" message >> is sent to a device that is already configured with the exact same >> configuration. > > Nonsense. The text explicitly says "configuration involves correctly > processing a SetConfiguration() request with a non-zero configuration > value." There's no requirement about what state the device was in > previously. > >>> Together these should explain the correct behavior. >> >> I'm not sure I understand what you're implying here. That the kernel's >> behaviour is correct or not? > > That the EHCI behavior is correct and the xHCI behavior is wrong. True, xHCI doesn't reset the toggle in this case. xHC only keeps track of added or dropped endpoints, it doesn't track which configuration or interface is set. If the SetConfiguration() request doesn't cause any endpoint add/drop change then xhci driver won't do anything. To reset the toggle we should mark the endpoints as both dropped and added, and issue a configure endpoint xhci command. The same xhci codepath is called from other places as well, I need to check a change like this won't cause any other issues -Mathias