diff options
author | Gregory Herrero <gregory.herrero@intel.com> | 2015-09-22 15:16:46 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-10-01 12:40:17 -0500 |
commit | 091473ad9b402f9e1b08a68a78b54e0d3c9affb6 (patch) | |
tree | 0d67275a50ed063d9bf1fa748f51811a05f1e551 /drivers/usb | |
parent | 08c4ffc24087d1949948002abdbac0d1e71ade5d (diff) |
usb: dwc2: host: disconnect hcd prior stopping it
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc2/hcd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 856e21cb6683..257f9579705d 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -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; |