Skip to content

Commit 59bfeaf

Browse files
Kai-Heng Fenggregkh
authored andcommitted
USB: core: Disable LPM only for non-suspended ports
There's USB error when tegra board is shutting down: [ 180.919315] usb 2-3: Failed to set U1 timeout to 0x0,error code -113 [ 180.919995] usb 2-3: Failed to set U1 timeout to 0xa,error code -113 [ 180.920512] usb 2-3: Failed to set U2 timeout to 0x4,error code -113 [ 186.157172] tegra-xusb 3610000.usb: xHCI host controller not responding, assume dead [ 186.157858] tegra-xusb 3610000.usb: HC died; cleaning up [ 186.317280] tegra-xusb 3610000.usb: Timeout while waiting for evaluate context command The issue is caused by disabling LPM on already suspended ports. For USB2 LPM, the LPM is already disabled during port suspend. For USB3 LPM, port won't transit to U1/U2 when it's already suspended in U3, hence disabling LPM is only needed for ports that are not suspended. Cc: Wayne Chang <[email protected]> Cc: stable <[email protected]> Fixes: d920a2e ("usb: Disable USB3 LPM at shutdown") Signed-off-by: Kai-Heng Feng <[email protected]> Acked-by: Alan Stern <[email protected]> Tested-by: Jon Hunter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0df11fa commit 59bfeaf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/usb/core/port.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,11 @@ static int usb_port_runtime_suspend(struct device *dev)
453453
static void usb_port_shutdown(struct device *dev)
454454
{
455455
struct usb_port *port_dev = to_usb_port(dev);
456+
struct usb_device *udev = port_dev->child;
456457

457-
if (port_dev->child) {
458-
usb_disable_usb2_hardware_lpm(port_dev->child);
459-
usb_unlocked_disable_lpm(port_dev->child);
458+
if (udev && !udev->port_is_suspended) {
459+
usb_disable_usb2_hardware_lpm(udev);
460+
usb_unlocked_disable_lpm(udev);
460461
}
461462
}
462463

0 commit comments

Comments
 (0)