usb: dwc2: host: disconnect hcd prior stopping it
authorGregory Herrero <gregory.herrero@intel.com>
Tue, 22 Sep 2015 13:16:46 +0000 (15:16 +0200)
committerFelipe Balbi <balbi@ti.com>
Thu, 1 Oct 2015 17:40:17 +0000 (12:40 -0500)
In case controller is asked to stop while devices are connected,
disconnect all devices and clean up before stopping.

Signed-off-by: Gregory Herrero <gregory.herrero@intel.com>
Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@intel.com>
Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Tested-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Tested-by: John Youn <johnyoun@synopsys.com>
Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc2/hcd.c

index 856e21cb66837830a9fad1b47e8514705e9fe07f..257f9579705d2edee7668d79146e9b61fcda3fb6 100644 (file)
@@ -2350,7 +2350,12 @@ static void _dwc2_hcd_stop(struct usb_hcd *hcd)
        struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd);
        unsigned long flags;
 
+       /* Wait for interrupt processing to finish */
+       synchronize_irq(hcd->irq);
+
        spin_lock_irqsave(&hsotg->lock, flags);
+       /* Ensure hcd is disconnected */
+       dwc2_hcd_disconnect(hsotg);
        dwc2_hcd_stop(hsotg);
        hsotg->lx_state = DWC2_L3;
        hcd->state = HC_STATE_HALT;
This page took 0.025859 seconds and 5 git commands to generate.