Commit a28bda34 authored by Mathias Nyman's avatar Mathias Nyman Committed by Khalid Elmously

xhci: Prevent device initiated U1/U2 link pm if exit latency is too long

BugLink: https://bugs.launchpad.net/bugs/1848780

commit cd9d9491 upstream.

If host/hub initiated link pm is prevented by a driver flag we still must
ensure that periodic endpoints have longer service intervals than link pm
exit latency before allowing device initiated link pm.

Fix this by continue walking and checking endpoint service interval if
xhci_get_timeout_no_hub_lpm() returns anything else than USB3_LPM_DISABLED

While at it fix the split line error message
Tested-by: default avatarJan Schmidt <jan@centricular.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/1570190373-30684-3-git-send-email-mathias.nyman@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 8c6ac185
......@@ -4651,10 +4651,12 @@ static u16 xhci_calculate_lpm_timeout(struct usb_hcd *hcd,
if (intf->dev.driver) {
driver = to_usb_driver(intf->dev.driver);
if (driver && driver->disable_hub_initiated_lpm) {
dev_dbg(&udev->dev, "Hub-initiated %s disabled "
"at request of driver %s\n",
state_name, driver->name);
return xhci_get_timeout_no_hub_lpm(udev, state);
dev_dbg(&udev->dev, "Hub-initiated %s disabled at request of driver %s\n",
state_name, driver->name);
timeout = xhci_get_timeout_no_hub_lpm(udev,
state);
if (timeout == USB3_LPM_DISABLED)
return timeout;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment