Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#15000 closed bug (fixed)

XHCI: Can't boot off USB3 drives (but USB2 drives and/or ports work OK)

Reported by: waddlesplash Owned by: nobody
Priority: blocker Milestone: R1/beta2
Component: Drivers/USB/XHCI Version: R1/Development
Keywords: Cc:
Blocked By: Blocking: #14999, #15014, #15061, #15186, #15490, #15570
Platform: All

Description

This seems to occur only on *some* hardware. At least my (rather common) Lynx Point controller is affected, as are the controllers on various Ryzen motherboards, and MacBooks also.

Oddly, said USB devices usually work when they are plugged in after boot, just not when they are booted from.

Change History (20)

comment:1 by waddlesplash, 5 years ago

It's possible there's some sort of rate issue here where we fire too many transactions to the device too soon after we did a power reset on all ports, perhaps? That's complete speculation though.

comment:2 by waddlesplash, 5 years ago

Blocking: 14999 added

comment:3 by waddlesplash, 5 years ago

As mentioned in the title, it is possible to boot via a USB2 flash drive on a USB3 port, or a USB3 flash drive on a USB2 port (even if said port is attached to the XHCI controller.) Something about USB3 mode is the issue here.

comment:4 by waddlesplash, 5 years ago

Debounce and wakeup times do not appear to be any different for USB3 than they were previously; at least I don't see any special handling in the Linux kernel here for this.

I do note that there are a variety of TODOs in XHCI::ConfigureEndpoint about USB2 vs. USB3 at present, most of which center around fetching the companion descriptor and then applying it to various settings. Probably that is relevant here.

comment:5 by waddlesplash, 5 years ago

Blocking: 15014 added

comment:6 by waddlesplash, 5 years ago

I just realized that, since we don't do any port resets after assuming control of the USB hardware, the USB devices will already have been configured for operation in USB3 mode, i.e. with all the parameters in ConfigureEndpoint already set from the companion descriptor. So when we set them the USB2 way, this is valid when doing an initial configuration and so the devices work after boot; but doing this for already-configured devices and never having the HCI renegotiate the link may be why things start locking up.

comment:7 by waddlesplash, 5 years ago

Blocking: 15061 added

comment:8 by waddlesplash, 5 years ago

Well, hrev53137 didn't actually help here. But I noticed while testing it (as did a user in #15061) that under USB3, the usb_disk driver does not even attempt to start on most controllers (despite the "new device connected" messages from XHCI appearing.) I wonder what's up with that? Probably it's related somehow.

comment:9 by waddlesplash, 5 years ago

hrev53194 improves this situation somewhat, though the instance of this described above ("new device connected" but no usb_disk) is not fixed; seems that's a separate issue.

comment:10 by waddlesplash, 5 years ago

Blocking: 15186 added

comment:11 by waddlesplash, 4 years ago

Milestone: UnscheduledR1/beta2
Priority: normalblocker

comment:12 by kallisti5, 4 years ago

This one should be fixed before R1 Beta2, but if nobody has the bandwidth are we going to block R1 Beta2 purely based on this issue?

comment:13 by waddlesplash, 4 years ago

Blocking: 15570 added

comment:14 by waddlesplash, 4 years ago

Blocking: 15490 added

comment:15 by koguma, 4 years ago

I'm not sure if this is related. When attempting to boot off a USB3.0 flash drive on an Asus UX305L laptop (all the ports are usb 3.0 I believe). The bootloader loads, but it's unable find the install media.

comment:16 by waddlesplash, 4 years ago

That is the problem this ticket tracks, yes. Using a USB2 drive, even in a USB3 port, should help.

comment:17 by yochanon, 4 years ago

Using hrev53834 on a USB3 flash drive in a USB3 or USB2 slot still makes it freeze up during startup after trying it earlier this morning.

In the USB3 slot, it stops with the 'can't find boot partition' thing.

In the USB2 slot, it gets all the way to showing all the little icons lighting (coloring in), then freezes at the last one.

So this is still a problem it seems, and I simply can't afford to go out buying USB flash drives any old time I want, no matter how 'cheap' some find them to be, since 'cheap' is relative and I barely keep a roof over my head or food in the cupboards on my disability check.

comment:18 by waddlesplash, 4 years ago

In the USB2 slot, it gets all the way to showing all the little icons lighting (coloring in), then freezes at the last one.

This is a different issue then; stopping on the rocket icon means the video driver failed to initialize.

comment:19 by waddlesplash, 4 years ago

Resolution: fixed
Status: newclosed

Fixed in hrev53854. At last!

comment:20 by ambroff, 4 years ago

Nice work dude!

Note: See TracTickets for help on using tickets.