[SeaBIOS] SeaBIOS recognising USB 3.0 on boot works - partly

Kevin O'Connor kevin at koconnor.net
Sat Dec 19 03:12:28 CET 2015

On Sat, Dec 19, 2015 at 01:49:04AM +0000, edward wandasiewicz wrote:
> Is it a technically a manufacturer messing up the USB spec definitions it
> should be following?

That's a great question, and I don't know the answer to it.  It would
be great if there was some guidance in the USB3 spec to help here as
that would help point out if this is a controller, device, or software

> Of all the USB drives I've come across, this Philips one is the only one
> that behaves like this.
> It's like its saying "hey, I'm a USB 2.0 spec device, no wait a moment, I'm
> really a USB 3.0 spec device." and we turn around and say "make ya mind
> up", by which time it's too late.

We've seen this USB2/3 confusion pop up a few times before - for
example, see:

This is the first time I've seen a report of a device/controller
having the confusion long enough for the USB2 instance to survive
through full drive detection.  (FYI, some of the issues in the emails
above I think were resolved with other fixes.)

> Sometimes we just can't fix every problem.
> Granted this one is a tough one to solve.

I don't think it's that difficult to address your particular hardware
- for example, see the patch below on top of the testing branch.  It's
unclear to me, however, what implications a change like the one below
would have on other people's hardware.  :-(


--- a/src/hw/usb.c
+++ b/src/hw/usb.c
@@ -441,10 +441,14 @@ usb_hub_port_setup(void *data)
     // Make sure device is still present (catches some weird USB3 devices)
-    ret = hub->op->detect(hub, port);
-    if (ret <= 0) {
-        hub->op->disconnect(hub, port);
-        goto done;
+    if (hub->cntl->type == USB_TYPE_XHCI && usbdev->speed == USB_HIGHSPEED) {
+        while (!timer_check(hub->detectend))
+            yield();
+        ret = hub->op->detect(hub, port);
+        if (ret <= 0) {
+            hub->op->disconnect(hub, port);
+            goto done;
+        }
     // Configure the device

More information about the SeaBIOS mailing list