On 24.8.2020 16.10, Martin Thierer wrote: >> 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. > > I'm not sure if it's relevant, but I found that calling libusb's > set_interface() *does* seem to reset the data toggles also on xhci > ports, even if it does not actually change the interface. > > Martin It does, I checked that usb_set_configuration() ends up dropping and re-adding the endpoint when it calls usb_hcd_alloc_bandwidth(), this should cause xhci driver to reset the toggles. Looks like libusb set_configuration could end up calling usb_reset_configuration() instead. If there are no changes it's possible usb_hcd_alloc_bandwidth() never gets called, and toggles never reset. see drivers/usb/core/devio.c proc_setconfig() -Mathias