]> www.infradead.org Git - nvme.git/commitdiff
usb: host: xhci-plat: Set XHCI_STATE_REMOVING before resuming XHCI HC
authorWesley Cheng <quic_wcheng@quicinc.com>
Wed, 31 May 2023 22:27:19 +0000 (15:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jun 2023 07:55:09 +0000 (09:55 +0200)
There are situations during the xhci_resume() sequence, which allows for
re-initializing of the XHCI HC.  However, in case the HCD is being removed,
these operations may not be needed.  Set the removal state before issuing
the runtime PM get on the XHCI device, so that the XHCI resume routine will
know when to bypass the re-init logic.

Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
Message-ID: <20230531222719.14143-3-quic_wcheng@quicinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci-plat.c

index 1d902d1513bc75db3bd2d7fab6e21f8004881b10..b26ea7cb4357b503a30ae66591492bcc0850cb0f 100644 (file)
@@ -398,8 +398,8 @@ void xhci_plat_remove(struct platform_device *dev)
        struct clk *reg_clk = xhci->reg_clk;
        struct usb_hcd *shared_hcd = xhci->shared_hcd;
 
-       pm_runtime_get_sync(&dev->dev);
        xhci->xhc_state |= XHCI_STATE_REMOVING;
+       pm_runtime_get_sync(&dev->dev);
 
        if (shared_hcd) {
                usb_remove_hcd(shared_hcd);