linux-stable/drivers/usb/core
Kai-Heng Feng d920a2ed86 usb: Disable USB3 LPM at shutdown
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-04-04 17:00:08 +02:00
..
Kconfig usb: core: Kconfig: Improve USB authorization mode help 2024-02-17 16:38:35 +01:00
Makefile
buffer.c - Yosry Ahmed brought back some cgroup v1 stats in OOM logs. 2023-06-28 10:28:11 -07:00
config.c usb: config: fix iteration issue in 'usb_get_bos_descriptor()' 2023-11-21 15:30:56 +01:00
devices.c USB: Remove remnants of Wireless USB and UWB 2023-08-09 14:17:06 +02:00
devio.c usb: convert to new timestamp accessors 2023-10-18 13:26:17 +02:00
driver.c usb: usb_autopm_get_interface use modern helper 2024-01-27 16:43:48 -08:00
endpoint.c usb: core: constify the struct device_type usage 2024-02-19 09:35:46 +01:00
file.c USB: make usb class a const structure 2023-07-25 17:49:30 +02:00
generic.c usb: core: Fix crash w/ usb_choose_configuration() if no driver 2023-12-15 13:54:09 +01:00
hcd-pci.c usb: pci-quirks: handle HAS_IOPORT dependency for AMD quirk 2023-10-02 16:19:12 +02:00
hcd.c USB/Thunderbolt changes for 6.9-rc1 2024-03-21 12:35:20 -07:00
hub.c USB: core: Add hub_get() and hub_put() routines 2024-03-26 15:02:12 +01:00
hub.h USB: core: Add hub_get() and hub_put() routines 2024-03-26 15:02:12 +01:00
ledtrig-usbport.c usb: core: Use module_led_trigger macro to simplify the code 2023-08-22 14:44:23 +02:00
message.c USB: document some API requirements on disconnection 2024-03-02 20:37:14 +01:00
notify.c
of.c usb: core: Set connect_type of ports based on DT node 2024-03-05 13:28:46 +00:00
otg_productlist.h
phy.c usb: core: add phy notify connect and disconnect 2024-01-27 17:36:14 -08:00
phy.h usb: core: add phy notify connect and disconnect 2024-01-27 17:36:14 -08:00
port.c usb: Disable USB3 LPM at shutdown 2024-04-04 17:00:08 +02:00
quirks.c usb: new quirk to reduce the SET_ADDRESS request timeout 2023-11-23 12:32:44 +00:00
sysfs.c USB: core: Fix deadlock in usb_deauthorize_interface() 2024-03-26 11:02:47 +01:00
urb.c USB: Remove remnants of Wireless USB and UWB 2023-08-09 14:17:06 +02:00
usb-acpi.c usb: usb-acpi: Fix oops due to freeing uninitialized pld pointer 2024-03-19 13:07:35 +01:00
usb.c usb: core: constify the struct device_type usage 2024-02-19 09:35:46 +01:00
usb.h usb: core: constify the struct device_type usage 2024-02-19 09:35:46 +01:00