Hello Dries and Tilman,

Thank you for providing the logs and other relevant information. For
clarification, when you were testing if the issue still exists, was this
from cold boot or warm boot?

And if you sometimes see it working from cold boot it indeed seems to be very 
racey. There now should be a 100ms power-on-to-good delay on all usb 3.0 hubs 
since 5.4.0-97, which seems like it used to delay whatever race seems to be 
going on when the roothubs are being registered (as per the discussion here 
https://bugzilla.kernel.org/show_bug.cgi?id=214021), but maybe that isn't 
enough to avoid the race in your case?
p.s. If you run lsusb -v as root you should be able to see the bPwrOn2PwrGood 
value of the root hubs as 100ms.

Also, the patchset that seemed to directly address this issue got
reverted due to regressions and never seemed to be re-addressed
upstream... there seem to be a lot of fixes for those introduced
problems since then though so maybe it would make sense to reintroduce
those patches.

I will send an email to the upstream usb mailing list asking about this
and see what their thoughts are.

Thanks, 
- Luke



** Bug watch added: Linux Kernel Bug Tracker #214021
   https://bugzilla.kernel.org/show_bug.cgi?id=214021

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux-intel-5.13 in Ubuntu.
https://bugs.launchpad.net/bugs/1939638

Title:
  [regression] USB device is not detected during boot

Status in HWE Next:
  New
Status in linux package in Ubuntu:
  Fix Released
Status in linux-intel package in Ubuntu:
  Confirmed
Status in linux-intel-5.13 package in Ubuntu:
  Fix Released
Status in linux source package in Focal:
  Fix Released
Status in linux-intel source package in Focal:
  Confirmed
Status in linux-intel-5.13 source package in Focal:
  Fix Released
Status in linux source package in Hirsute:
  Fix Released
Status in linux-intel source package in Hirsute:
  Invalid
Status in linux-intel-5.13 source package in Hirsute:
  Invalid

Bug description:
  [SRU Justification]

  [Impact]
  The USB devices (keyboard, storage...) are failed to be detected when 
connecting to the problematic root hubs which need longer PowerOn-to-PowerGood 
delay than it claims in the hub descriptor. It's caused by the upstream fix 
90d28fb53d4a ("usb: core: reduce power-on-good delay time of root hub").

  
  [Fix]
  Reverting the upstream fix until a formal fix been placed.

  [Test Case]
  1. Plug the USB device to the ports of problematic root hub.
  2. Power on the machine.
  3. Check if the USB device can work or not after boot.

  [Regression Potential]
  Low. The longer delay is proven safe in old kernels.

  ========== Original Bug Description ==========

  [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

To manage notifications about this bug go to:
https://bugs.launchpad.net/hwe-next/+bug/1939638/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to