Skip to content

Commit fb2ce17

Browse files
wcheng-enggregkh
authored andcommitted
usb: host: xhci: Do not re-initialize the XHCI HC if being removed
During XHCI resume, if there was a host controller error detected the routine will attempt to re-initialize the XHCI HC, so that it can return back to an operational state. If the XHCI host controller is being removed, this sequence would be already handled within the XHCI halt path, leading to a duplicate set of reg ops/calls. In addition, since the XHCI bus is being removed, the overhead added in restarting the HCD is unnecessary. Check for the XHC state before setting the reinit_xhc parameter, which is responsible for triggering the restart. Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> Message-ID: <20230531222719.14143-2-quic_wcheng@quicinc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 256a02e commit fb2ce17

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/usb/host/xhci.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,8 @@ int xhci_resume(struct xhci_hcd *xhci, pm_message_t msg)
10281028
temp = readl(&xhci->op_regs->status);
10291029

10301030
/* re-initialize the HC on Restore Error, or Host Controller Error */
1031-
if (temp & (STS_SRE | STS_HCE)) {
1031+
if ((temp & (STS_SRE | STS_HCE)) &&
1032+
!(xhci->xhc_state & XHCI_STATE_REMOVING)) {
10321033
reinit_xhc = true;
10331034
if (!xhci->broken_suspend)
10341035
xhci_warn(xhci, "xHC error in resume, USBSTS 0x%x, Reinit\n", temp);

0 commit comments

Comments
 (0)