Comment 0 for bug 1939638

Revision history for this message
Chris Chiu (mschiu77) wrote : USB device is not detected during boot

[Summary]

The USB devices (keyboard, storage...) are failed to be detected during boot after upgrade to UBUNTU focal kernel 5.4.0-78 and hirsute 5.11.0-26. However, they will be detected and working ok after re-plugging. The kernel output shows as down below during boot
[ 39.350435] hub 1-0:1.0: USB hub found
[ 39.398835] hub 1-0:1.0: 12 ports detected
[ 39.622744] usb usb1-port3: couldn't allocate usb_device

And when I plug out then plug in the same device, it shows
[57210.794140] usb 1-3: new low-speed USB device number 4 using xhci_hcd
[57210.951289] usb 1-3: New USB device found, idVendor=17ef, idProduct=6099, bcdDevice= 1.14
[57210.951293] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=0

After doing kernel bisecting, we found the upstream commit https://github.com/torvalds/linux/commit/90d28fb53d4a51299ff324dede015d5cb11b88a2 makes the difference. It indicates that the delay for the root hub from power_on to power_good is not long enough. There was no problem if the delay is 100 ms. From the Hub Descriptor of the root hub, the value is 10 * 2 milliseconds. And the XHCI spec also says in section 5.4.8
"""
The host is required to have power stable to the port within 20 milliseconds of the '0' to '1' transition of PP. If PPC = '1', software is responsible for waiting 20ms.
"""

The commit seems to follow the SPEC but could cause problems on some hubs.

[Reproduce Steps]
1. Plug the USB device to the physical port #1 and #4 which belongs to high-speed hub.
2. Power on the machine.
3. Check if the USB device can work or not after boot.

[Results]
Expected:
  All usb devices connect to the hub should work OK.

Actual:
  USB devices connects to high-speed hub can not be probed.

[Additional Information]
Kernel Version: focal 5.4.0-78 and hirsute 5.11.0-26

[Upstream bug]
https://bugzilla.kernel.org/show_bug.cgi?id=214021