linux-stable/drivers/usb
Kai-Heng Feng 5160b4bd4d usb: Disable USB3 LPM at shutdown
commit d920a2ed86 upstream.

SanDisks USB3 storage may disapper after system reboot:

usb usb2-port3: link state change
xhci_hcd 0000:00:14.0: clear port3 link state change, portsc: 0x2c0
usb usb2-port3: do warm reset, port only
xhci_hcd 0000:00:14.0: xhci_hub_status_data: stopping usb2 port polling
xhci_hcd 0000:00:14.0: Get port status 2-3 read: 0x2b0, return 0x2b0
usb usb2-port3: not warm reset yet, waiting 50ms
xhci_hcd 0000:00:14.0: Get port status 2-3 read: 0x2f0, return 0x2f0
usb usb2-port3: not warm reset yet, waiting 200ms
...
xhci_hcd 0000:00:14.0: Get port status 2-3 read: 0x6802c0, return 0x7002c0
usb usb2-port3: not warm reset yet, waiting 200ms
xhci_hcd 0000:00:14.0: clear port3 reset change, portsc: 0x4802c0
xhci_hcd 0000:00:14.0: clear port3 warm(BH) reset change, portsc: 0x4002c0
xhci_hcd 0000:00:14.0: clear port3 link state change, portsc: 0x2c0
xhci_hcd 0000:00:14.0: Get port status 2-3 read: 0x2c0, return 0x2c0
usb usb2-port3: not enabled, trying warm reset again...

This is due to the USB device still cause port change event after xHCI is
shuted down:

xhci_hcd 0000:38:00.0: // Setting command ring address to 0xffffe001
xhci_hcd 0000:38:00.0: xhci_resume: starting usb3 port polling.
xhci_hcd 0000:38:00.0: xhci_hub_status_data: stopping usb4 port polling
xhci_hcd 0000:38:00.0: xhci_hub_status_data: stopping usb3 port polling
xhci_hcd 0000:38:00.0: hcd_pci_runtime_resume: 0
xhci_hcd 0000:38:00.0: xhci_shutdown: stopping usb3 port polling.
xhci_hcd 0000:38:00.0: // Halt the HC
xhci_hcd 0000:38:00.0: xhci_shutdown completed - status = 1
xhci_hcd 0000:00:14.0: xhci_shutdown: stopping usb1 port polling.
xhci_hcd 0000:00:14.0: // Halt the HC
xhci_hcd 0000:00:14.0: xhci_shutdown completed - status = 1
xhci_hcd 0000:00:14.0: Get port status 2-3 read: 0x1203, return 0x203
xhci_hcd 0000:00:14.0: set port reset, actual port 2-3 status  = 0x1311
xhci_hcd 0000:00:14.0: Get port status 2-3 read: 0x201203, return 0x100203
xhci_hcd 0000:00:14.0: clear port3 reset change, portsc: 0x1203
xhci_hcd 0000:00:14.0: clear port3 warm(BH) reset change, portsc: 0x1203
xhci_hcd 0000:00:14.0: clear port3 link state change, portsc: 0x1203
xhci_hcd 0000:00:14.0: clear port3 connect change, portsc: 0x1203
xhci_hcd 0000:00:14.0: Get port status 2-3 read: 0x1203, return 0x203
usb 2-3: device not accepting address 2, error -108
xhci_hcd 0000:00:14.0: xHCI dying or halted, can't queue_command
xhci_hcd 0000:00:14.0: Set port 2-3 link state, portsc: 0x1203, write 0x11261
xhci_hcd 0000:00:14.0: Get port status 2-3 read: 0x1263, return 0x263
xhci_hcd 0000:00:14.0: set port reset, actual port 2-3 status  = 0x1271
xhci_hcd 0000:00:14.0: Get port status 2-3 read: 0x12b1, return 0x2b1
usb usb2-port3: not reset yet, waiting 60ms
ACPI: PM: Preparing to enter system sleep state S5
xhci_hcd 0000:00:14.0: Get port status 2-3 read: 0x12f1, return 0x2f1
usb usb2-port3: not reset yet, waiting 200ms
reboot: Restarting system

The port change event is caused by LPM transition, so disabling LPM at shutdown
to make sure the device is in U0 for warmboot.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Cc: stable <stable@kernel.org>
Link: https://lore.kernel.org/r/20240305065140.66801-1-kai.heng.feng@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-05-02 16:23:39 +02:00
..
atm
c67x00
cdns3 usb: cdns3: fix memory double free when handle zero packet 2024-03-01 13:16:49 +01:00
chipidea usb: chipidea: wait controller resume finished for wakeup irq 2024-01-25 14:37:51 -08:00
class Revert "usb: cdc-wdm: close race between read and workqueue" 2024-05-02 16:23:39 +02:00
common usb: common: usb-conn-gpio: Prevent bailing out if initial role is none 2023-08-16 18:21:00 +02:00
core usb: Disable USB3 LPM at shutdown 2024-05-02 16:23:39 +02:00
dwc2 usb: dwc2: host: Fix dereference issue in DDMA completion flow. 2024-05-02 16:23:39 +02:00
dwc3 Revert "usb: dwc3: don't reset device side if dwc3 was configured as host-only" 2024-01-25 14:37:51 -08:00
early
gadget usb: udc: remove warning when queue disabled ep 2024-04-13 12:59:10 +02:00
host usb: sl811-hcd: only defined function checkdone if QUIRK2 is defined 2024-04-13 12:59:52 +02:00
image
isp1760
misc USB: sisusbvga: Add endpoint checks 2023-05-30 12:57:57 +01:00
mon usb: mon: Fix atomicity violation in mon_bin_vma_fault 2024-01-25 14:37:52 -08:00
mtu3 usb: mtu3: fix kernel panic at qmu transfer done irq handler 2023-05-17 11:47:58 +02:00
musb usb: musb: Modify the "HWVers" register address 2023-10-25 11:54:15 +02:00
phy Revert "usb: phy: generic: Get the vbus supply" 2024-04-13 12:59:30 +02:00
renesas_usbhs
roles usb: roles: don't get/set_role() when usb_role_switch is unregistered 2024-03-01 13:16:49 +01:00
serial USB: serial: option: add Telit FN920C04 rmnet compositions 2024-05-02 16:23:39 +02:00
storage USB: usb-storage: Prevent divide-by-0 error in isd200_ata_command 2024-04-13 12:58:50 +02:00
typec usb: typec: tcpci: add generic tcpci fallback compatible 2024-04-13 12:59:51 +02:00
usbip USB: usbip: fix stub_dev hub disconnect 2023-11-20 11:06:53 +01:00
Kconfig
Makefile
usb-skeleton.c