blob: d2fbca225f3f39fec0fc2100b00539c5d328bb35 [file] [log] [blame]
From 19a88c52c069c92105fec93328fe838108b70565 Mon Sep 17 00:00:00 2001
From: Mathias Nyman <>
Date: Thu, 12 Mar 2020 16:45:09 +0200
Subject: [PATCH] xhci: bail out early if driver can't accress host in resume
commit 72ae194704da212e2ec312ab182a96799d070755 upstream.
Bail out early if the xHC host needs to be reset at resume
but driver can't access xHC PCI registers.
If xhci driver already fails to reset the controller then there
is no point in attempting to free, re-initialize, re-allocate and
re-start the host. If failure to access the host is detected later,
failing the resume, xhci interrupts will be double freed
when remove is called.
Signed-off-by: Mathias Nyman <>
Signed-off-by: Greg Kroah-Hartman <>
Signed-off-by: Paul Gortmaker <>
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index d3dd7264c928..ab3a59d0b8d8 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -1157,8 +1157,10 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
xhci_dbg(xhci, "Stop HCD\n");
- xhci_reset(xhci);
+ retval = xhci_reset(xhci);
+ if (retval)
+ return retval;
xhci_dbg(xhci, "// Disabling event ring interrupts\n");