Comment 7 for bug 1668105

Revision history for this message
Richard (ismail-a) wrote : Re: xhci_kcd module turns off usb host controller on boot

Causes:

Since beginning of Apple UEFI, Linux UEFI has booted with usb3 in bad mode during the UEFI boot sequence. This was the case whenever the previous shutdown was not a graceful Linux shutdown, ie. a crash, abrupt shutdown by long press on power key or a macOS session. Because the wait between a key presses and it being effective, boot is cumbersome. Additionally, in the bad mode, timers are 12x slower so every grub second is 12 s, and the UEFI boot additionally takes 1 to 2 minutes.

The bad mode entailed that mouse and keyboard only works for 2 s every 10-20 s with a type-ahead buffer of about 10 characters. The bad mode was active during the UEFI phase until the kernel loaded from the boot directory.

Linux always had usb3 problems, which can be shown by any computer with usb3 hardware, and thus the xhci_hcd kernel module, over time shutting down various usb devices or the entire usb subsystem. This is what causes the console keyboard to be dead on a computer with a month or more of up-time, forcing a power off should networked ssh become unavailable.

Before kernel 4.8, the usb3 troubles only affected Linux. macOS and the UEFI Startup Manager (option-boot) were not affected.

With kernel 4.8, the presence of a Linux installation affects the boot manager and regular macOS boot making the only boot option Apple rescue mode (option+R.) All booting not preceded by a graceful Linux shutdown is also extremely slow, about 2 minutes.
- The way to boot macOS is to boot Apple rescue mode that resets usb, then boot macOS
- The way to boot Linux is the get-around above

Additionally in 4.8, the xhci_kcd module, that is built-in and cannot be removed, decides to halt the usb host controller making password input impossible. This is what prevents booting without get-around tricks.

usb3 has been a problem in Linux since its introduction. It's time to fix that.