Skip to content

Commit f0c472a

Browse files
khfenggregkh
authored andcommitted
xhci: Return if xHCI doesn't support LPM
Just return if xHCI is quirked to disable LPM. We can save some time from reading registers and doing spinlocks. Add stable tag as we want this patch together with the next one, "Poll for U0 after disabling USB2 LPM" which fixes a suspend issue for some USB2 LPM devices Cc: [email protected] Signed-off-by: Kai-Heng Feng <[email protected]> Signed-off-by: Mathias Nyman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a24d507 commit f0c472a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/usb/host/xhci.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4391,6 +4391,9 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
43914391
int hird, exit_latency;
43924392
int ret;
43934393

4394+
if (xhci->quirks & XHCI_HW_LPM_DISABLE)
4395+
return -EPERM;
4396+
43944397
if (hcd->speed >= HCD_USB3 || !xhci->hw_lpm_support ||
43954398
!udev->lpm_capable)
43964399
return -EPERM;
@@ -4413,7 +4416,7 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
44134416
xhci_dbg(xhci, "%s port %d USB2 hardware LPM\n",
44144417
enable ? "enable" : "disable", port_num + 1);
44154418

4416-
if (enable && !(xhci->quirks & XHCI_HW_LPM_DISABLE)) {
4419+
if (enable) {
44174420
/* Host supports BESL timeout instead of HIRD */
44184421
if (udev->usb2_hw_lpm_besl_capable) {
44194422
/* if device doesn't have a preferred BESL value use a

0 commit comments

Comments
 (0)