Skip to content

Commit

Permalink
xhci: bail out early if driver can't accress host in resume
Browse files Browse the repository at this point in the history
[ Upstream commit 72ae194 ]

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>
  • Loading branch information
matnyman authored and gregkh committed Apr 17, 2020
1 parent 61ed3dc commit 99e20a7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/usb/host/xhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,8 +1157,10 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
xhci_dbg(xhci, "Stop HCD\n");
xhci_halt(xhci);
xhci_zero_64b_regs(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");
Expand Down

0 comments on commit 99e20a7

Please sign in to comment.