Public bug reported:

[Impact]
On HP systems with Intel Panther Lake-H (PCH xHCI 8086:e37d), a SanDisk USB 3.2 
Gen 1 flash drive on a USB3 root port is not detected after a warm reboot (sudo 
reboot). A cold boot always brings it back.

After the failed warm boot the port never sees a connection (CCS=0). It
loops between Polling and SS.Inactive. The hub warm resets the port over
and over with no effect. The drive does not show up on the USB2 bus
either, and dmesg has no "usb 4-2" lines.

Error log (7.0.0-1015-oem, same symptom on 7.0.0-1016-oem):
  usb usb4-port2: not warm reset yet, waiting 200ms      (about 8600 times in 
30 minutes)
  hub 4-0:1.0: port_wait_reset: err = -16
  port status: portsc 0x2f0 (Polling), CCS=0

The platform keeps VBUS up across a warm reset, and the host cannot
switch port power (HCCPARAMS1 PPC=0). So the drive stays powered and
keeps a stale USB3 link state into the next boot. The kernel cannot
power-cycle the drive, because the hub recovery path only runs after a
connect event, which never happens.

Hits 3 of 3 warm reboots on 7.0.0-1016-oem. CID: 202512-38220.

[Fix]
Add quirk XHCI_DISABLE_USB3_PORTS_ON_REBOOT for the Intel Panther Lake-H PCH 
xHCI (8086:e37d). On SYSTEM_RESTART only, xhci_pci_shutdown() disables each 
connected USB3 root port (writes PED) before the controller is halted, then 
waits 100 ms. The link goes to SS.Disabled while the device is still powered. 
So the device sees a normal link loss and resets its own state before the 
platform reset. The next HCRST from boot firmware or the driver puts the ports 
back to their default state.

This reuses the port disable that xhci_pci_poweroff_late() already does
for U3 ports. Power off, S5 wake and all other controllers are not
changed. A generic port power off at shutdown (commit 83810f84ecf1)
caused regressions, so the quirk is limited to this controller and to
restart.

Upstream: none. This is an OEM-only patch (UBUNTU: SAUCE), commit
267b5018e6e8. No upstream fix exists for this root cause. The in-tree
_PRR recovery hook (01d9fb3ba343) does not help here, because the port
never reports a connection. The same failure reproduces on mainline 7.3
(a804c5742bff) only intermittently, so no fixing upstream commit could
be found.

[Test Plan]
Reproducer (run on the affected HP system, one SanDisk USB3 flash drive on a 
USB3 root port, usb4-port2 / bus 4-2):
1. Cold boot. Power the system fully off and back on (for a remote run: rtcwake 
-m off -s 60). Log in.
2. Check the drive is present: lsusb | grep 0781:55a9 and dmesg | grep "usb 
4-2" should show "new SuperSpeed USB device".
3. Warm reboot: sudo reboot.
4. After the system is back, check again: lsusb | grep 0781:55a9 and dmesg | 
grep "usb 4-2".
5. Repeat steps 1-4 three times.

Without the patch (7.0.0-1016-oem): reproduced 3 of 3. After each cold
boot the drive enumerates on usb4-2 (portsc 0x1203, U0, CCS). After each
warm reboot the drive is missing from lsusb, there are no "usb 4-2"
lines in dmesg, and the port stays in Polling (portsc 0x2f0, CCS=0).

With the patch: not yet run on hardware. The patch was only build-tested
(compiles with no warnings at W=1, package build passes). Expected
result: the same 3-run procedure shows the drive enumerating on usb4-2
after every warm reboot, with no port stuck in Polling. This test must
be run before the SRU is submitted.

[Where problems could occur]
Could break the USB restart path on Intel Panther Lake-H systems only 
(xhci-pci). The quirk matches the PCI ID, so other platforms and other USB3 
ports are not affected.

If the port disable or the 100 ms wait goes wrong, a reboot could stall
in xhci shutdown, or a USB3 device could see the link drop and handle it
badly. Dmesg would show xhci errors at shutdown, and the reboot could be
slower or hang. A USB storage device still mounted at reboot could also
see I/O errors, though a normal reboot already unmounts it first.

** Affects: hwe-next
     Importance: Undecided
         Status: New

** Affects: linux-oem-7.0 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: jira-stella-4240 oem-priority resolute stella

** Tags added: jira-stella-4240 oem-priority stella

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2171824

Title:
  USB3 flash drive not detected after warm reboot on Intel Panther
  Lake-H

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


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to