提交 f0c472a6 编写于 作者: K Kai-Heng Feng 提交者: Greg Kroah-Hartman

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: stable@vger.kernel.org
Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200624135949.22611-5-mathias.nyman@linux.intel.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a24d5072
...@@ -4391,6 +4391,9 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, ...@@ -4391,6 +4391,9 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
int hird, exit_latency; int hird, exit_latency;
int ret; int ret;
if (xhci->quirks & XHCI_HW_LPM_DISABLE)
return -EPERM;
if (hcd->speed >= HCD_USB3 || !xhci->hw_lpm_support || if (hcd->speed >= HCD_USB3 || !xhci->hw_lpm_support ||
!udev->lpm_capable) !udev->lpm_capable)
return -EPERM; return -EPERM;
...@@ -4413,7 +4416,7 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, ...@@ -4413,7 +4416,7 @@ static int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd,
xhci_dbg(xhci, "%s port %d USB2 hardware LPM\n", xhci_dbg(xhci, "%s port %d USB2 hardware LPM\n",
enable ? "enable" : "disable", port_num + 1); enable ? "enable" : "disable", port_num + 1);
if (enable && !(xhci->quirks & XHCI_HW_LPM_DISABLE)) { if (enable) {
/* Host supports BESL timeout instead of HIRD */ /* Host supports BESL timeout instead of HIRD */
if (udev->usb2_hw_lpm_besl_capable) { if (udev->usb2_hw_lpm_besl_capable) {
/* if device doesn't have a preferred BESL value use a /* if device doesn't have a preferred BESL value use a
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册