usb: fix deadlock caused by switching usb serial port
authorYue Wang <yue.wang@amlogic.com>
Wed, 17 Oct 2018 01:54:52 +0000 (21:54 -0400)
committerJianxin Pan <jianxin.pan@amlogic.com>
Thu, 18 Oct 2018 01:50:49 +0000 (18:50 -0700)
PD#174679: usb: Fix deadlock caused by switching usb serial port.

Change-Id: I0bc9bb5d15b5794cfb8e218c03a98c395713e4c0
Signed-off-by: Yue Wang <yue.wang@amlogic.com>
drivers/usb/host/xhci-ring.c

index 8b1e766..0f3d40a 100644 (file)
@@ -1706,13 +1706,13 @@ cleanup:
         * bits are still set.  When an event occurs, switch over to
         * polling to avoid losing status changes.
         */
+       xhci_dbg(xhci, "%s: starting port polling.\n", __func__);
+       set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
+       spin_unlock(&xhci->lock);
 #ifdef CONFIG_AMLOGIC_USB
        if (!(temp & PORT_CONNECT) || !(temp & PORT_PE))
                set_usb_phy_host_tuning(faked_port_index, 1);
 #endif
-       xhci_dbg(xhci, "%s: starting port polling.\n", __func__);
-       set_bit(HCD_FLAG_POLL_RH, &hcd->flags);
-       spin_unlock(&xhci->lock);
        /* Pass this up to the core */
        usb_hcd_poll_rh_status(hcd);
        spin_lock(&xhci->lock);