]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
xhci: bail out early if driver can't accress host in resume
authorMathias Nyman <mathias.nyman@linux.intel.com>
Thu, 12 Mar 2020 14:45:09 +0000 (16:45 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 29 Apr 2020 12:55:56 +0000 (14:55 +0200)
BugLink: https://bugs.launchpad.net/bugs/1874502
[ Upstream commit 72ae194704da212e2ec312ab182a96799d070755 ]

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 <mathias.nyman@linux.intel.com>
Link: https://lore.kernel.org/r/20200312144517.1593-2-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/usb/host/xhci.c

index 28edf2734f883b26b044ea8767aaec2a8c5583fa..7e7925d78adc465c5ec015ec9df2ee45c15a5da1 100644 (file)
@@ -1092,8 +1092,10 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
 
                xhci_dbg(xhci, "Stop HCD\n");
                xhci_halt(xhci);
-               xhci_reset(xhci);
+               retval = xhci_reset(xhci);
                spin_unlock_irq(&xhci->lock);
+               if (retval)
+                       return retval;
                xhci_cleanup_msix(xhci);
 
                xhci_dbg(xhci, "// Disabling event ring interrupts\n");