From: Yue Wang Date: Wed, 17 Oct 2018 01:54:52 +0000 (-0400) Subject: usb: fix deadlock caused by switching usb serial port X-Git-Tag: khadas-vims-v0.9.6-release~1276 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4bae26a45dbc5ae962266914a647706a20fd2253;p=platform%2Fkernel%2Flinux-amlogic.git usb: fix deadlock caused by switching usb serial port PD#174679: usb: Fix deadlock caused by switching usb serial port. Change-Id: I0bc9bb5d15b5794cfb8e218c03a98c395713e4c0 Signed-off-by: Yue Wang --- diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 8b1e766..0f3d40a 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -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);