usb: dwc_otg: prevent re-submit urb when disconnect detected
authorlyz <lyz@rock-chips.com>
Fri, 19 Jun 2015 11:08:44 +0000 (19:08 +0800)
committerlyz <lyz@rock-chips.com>
Fri, 19 Jun 2015 11:09:05 +0000 (19:09 +0800)
Signed-off-by: lyz <lyz@rock-chips.com>
drivers/usb/dwc_otg_310/dwc_otg_hcd.c

index 4f2e7ac8a1b7d7128ba67a79f994ba50ad0feeeb..09881639192bd3c0206fe494a346d1a199fbd14c 100755 (executable)
@@ -483,6 +483,12 @@ void dwc_otg_hcd_stop(dwc_otg_hcd_t *hcd)
        /* Turn off all host-specific interrupts. */
        dwc_otg_disable_host_interrupts(hcd->core_if);
 
+       /*
+        * Set status flags for the hub driver.
+        */
+       hcd->flags.b.port_connect_status_change = 1;
+       hcd->flags.b.port_connect_status = 0;
+
        /*
         * The root hub should be disconnected before this function is called.
         * The disconnect will clear the QTD lists (via ..._hcd_urb_dequeue)
@@ -492,12 +498,6 @@ void dwc_otg_hcd_stop(dwc_otg_hcd_t *hcd)
        kill_all_urbs(hcd);
        DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags);
 
-       /*
-        * Set status flags for the hub driver.
-        */
-       hcd->flags.b.port_connect_status_change = 1;
-       hcd->flags.b.port_connect_status = 0;
-
        /* Turn off the vbus power */
        DWC_PRINTF("PortPower off\n");
        hprt0.b.prtpwr = 0;