aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/xhci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/xhci.c')
-rw-r--r--drivers/usb/host/xhci.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index b4aa79d154b2..d8f640b12dd9 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -466,7 +466,7 @@ static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci)
466 * Systems: 466 * Systems:
467 * Vendor: Hewlett-Packard -> System Models: Z420, Z620 and Z820 467 * Vendor: Hewlett-Packard -> System Models: Z420, Z620 and Z820
468 */ 468 */
469static bool compliance_mode_recovery_timer_quirk_check(void) 469bool xhci_compliance_mode_recovery_timer_quirk_check(void)
470{ 470{
471 const char *dmi_product_name, *dmi_sys_vendor; 471 const char *dmi_product_name, *dmi_sys_vendor;
472 472
@@ -517,7 +517,7 @@ int xhci_init(struct usb_hcd *hcd)
517 xhci_dbg(xhci, "Finished xhci_init\n"); 517 xhci_dbg(xhci, "Finished xhci_init\n");
518 518
519 /* Initializing Compliance Mode Recovery Data If Needed */ 519 /* Initializing Compliance Mode Recovery Data If Needed */
520 if (compliance_mode_recovery_timer_quirk_check()) { 520 if (xhci_compliance_mode_recovery_timer_quirk_check()) {
521 xhci->quirks |= XHCI_COMP_MODE_QUIRK; 521 xhci->quirks |= XHCI_COMP_MODE_QUIRK;
522 compliance_mode_recovery_timer_init(xhci); 522 compliance_mode_recovery_timer_init(xhci);
523 } 523 }
@@ -956,6 +956,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
956 struct usb_hcd *hcd = xhci_to_hcd(xhci); 956 struct usb_hcd *hcd = xhci_to_hcd(xhci);
957 struct usb_hcd *secondary_hcd; 957 struct usb_hcd *secondary_hcd;
958 int retval = 0; 958 int retval = 0;
959 bool comp_timer_running = false;
959 960
960 /* Wait a bit if either of the roothubs need to settle from the 961 /* Wait a bit if either of the roothubs need to settle from the
961 * transition into bus suspend. 962 * transition into bus suspend.
@@ -993,6 +994,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
993 994
994 /* If restore operation fails, re-initialize the HC during resume */ 995 /* If restore operation fails, re-initialize the HC during resume */
995 if ((temp & STS_SRE) || hibernated) { 996 if ((temp & STS_SRE) || hibernated) {
997
998 if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) &&
999 !(xhci_all_ports_seen_u0(xhci))) {
1000 del_timer_sync(&xhci->comp_mode_recovery_timer);
1001 xhci_dbg(xhci, "Compliance Mode Recovery Timer deleted!\n");
1002 }
1003
996 /* Let the USB core know _both_ roothubs lost power. */ 1004 /* Let the USB core know _both_ roothubs lost power. */
997 usb_root_hub_lost_power(xhci->main_hcd->self.root_hub); 1005 usb_root_hub_lost_power(xhci->main_hcd->self.root_hub);
998 usb_root_hub_lost_power(xhci->shared_hcd->self.root_hub); 1006 usb_root_hub_lost_power(xhci->shared_hcd->self.root_hub);
@@ -1035,6 +1043,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1035 retval = xhci_init(hcd->primary_hcd); 1043 retval = xhci_init(hcd->primary_hcd);
1036 if (retval) 1044 if (retval)
1037 return retval; 1045 return retval;
1046 comp_timer_running = true;
1047
1038 xhci_dbg(xhci, "Start the primary HCD\n"); 1048 xhci_dbg(xhci, "Start the primary HCD\n");
1039 retval = xhci_run(hcd->primary_hcd); 1049 retval = xhci_run(hcd->primary_hcd);
1040 if (!retval) { 1050 if (!retval) {
@@ -1076,7 +1086,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1076 * to suffer the Compliance Mode issue again. It doesn't matter if 1086 * to suffer the Compliance Mode issue again. It doesn't matter if
1077 * ports have entered previously to U0 before system's suspension. 1087 * ports have entered previously to U0 before system's suspension.
1078 */ 1088 */
1079 if (xhci->quirks & XHCI_COMP_MODE_QUIRK) 1089 if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && !comp_timer_running)
1080 compliance_mode_recovery_timer_init(xhci); 1090 compliance_mode_recovery_timer_init(xhci);
1081 1091
1082 /* Re-enable port polling. */ 1092 /* Re-enable port polling. */