This series reworks the timing of USB detection. Previously, the USB controllers would wait for the port power to stabilize and then immiediately check for device presence. Unfortunately, the USB specification (USB2 spec) allows for devices to wait up to 100ms from the time that power is stable to the time they assert their presence. This series changes the controllers to behave more like the existing usb-hub code - each port will repeatedly re-check for device presence for 100ms after power is stable.
This may also help with USB3 device detection. In particular there were reports of devices that start off identifying as USB2 and then later change to a USB3 type device. The additional polling may catch these cases.
This series could cause a slight increase in overall boot time (due to the additional 100ms polling). However, when SeaBIOS' threads are enabled, I think only a few unusual corner cases would cause higher boot times.
The series is a fairly significant change to the initial USB timing behaviour. I ran tests on a bunch of USB devices and did not see any regressions. More testing would be appreciated.
The series is also at: https://github.com/KevinOConnor/seabios/tree/testing
-Kevin
Kevin O'Connor (7): ehci: Move port power up from ehci_hub_detect() to check_ehci_ports(). usb-hub: Enable power to all ports prior to calling usb_enumerate(). xhci: Change xhci_hub_detect() to use connect status instead of link state. uhci: Repeatedly poll for device detect for 100ms. ohci: Repeatedly poll for device detect for 100ms. ehci: Stall uhci/ohci init only until default port routing is done. usb: Perform device detect polling on all usb controllers.
src/hw/usb-ehci.c | 58 +++++++++++++++++++++++++------------------------------ src/hw/usb-hub.c | 46 +++++++++++++++---------------------------- src/hw/usb-ohci.c | 8 +------- src/hw/usb-uhci.c | 7 +++---- src/hw/usb-xhci.c | 16 +++++---------- src/hw/usb.c | 21 ++++++++++++++------ src/hw/usb.h | 2 +- 7 files changed, 67 insertions(+), 91 deletions(-)