USB: core: Disable LPM only for non-suspended ports
PATCH 1/1 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.
--- drivers/usb/core/port.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/usb/core/port.c +4 -3
@@ -452,10 +452,11 @@ static int usb_port_runtime_suspend(struct device *dev)static void usb_port_shutdown (struct device *dev) {struct usb_port *port_dev =to_usb_port (dev); +struct usb_device *udev = port_dev->child; -if (port_dev->child) { -usb_disable_usb2_hardware_lpm (port_dev->child); -usb_unlocked_disable_lpm (port_dev->child); +if (udev && !pm_runtime_suspended (&udev->dev)) { +usb_disable_usb2_hardware_lpm (udev); +usb_unlocked_disable_lpm (udev); } }
Signature · 1 line
2.47.0
Greg KH
maintainerQuoted 44 lines · Kai-Heng Feng
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 commandThe 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]>Fixes d920a2ed8620 ("usb: Disable USB3 LPM at shutdown")Signed-off-by Kai-Heng Feng <[email protected]>--- drivers/usb/core/port.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)drivers/usb/core/port.c +4
-3@@ -452,10 +452,11 @@ static int usb_port_runtime_suspend(struct device *dev)static void usb_port_shutdown (struct device *dev) {struct usb_port *port_dev =to_usb_port (dev); +struct usb_device *udev = port_dev->child; -if (port_dev->child) { -usb_disable_usb2_hardware_lpm (port_dev->child); -usb_unlocked_disable_lpm (port_dev->child); +if (udev && !pm_runtime_suspended (&udev->dev)) { +usb_disable_usb2_hardware_lpm (udev); +usb_unlocked_disable_lpm (udev); } }Signature · 1 line
2.47.0
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- You have marked a patch with a "Fixes:" tag for a commit that is in an older released kernel, yet you do not have a cc: stable line in the signed-off-by area at all, which means that the patch will not be applied to any older kernel releases. To properly fix this, please follow the documented rules in the Documentation/process/stable-kernel-rules.rst file for how to resolve this.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot