Linux Kernels

usb: dwc2: host: disconnect hcd prior stopping it

This change “usb: dwc2: host: disconnect hcd prior stopping it” (commit 091473a) in Linux kernel is authored by Gregory Herrero <gregory.herrero [at] intel.com> on Tue Sep 22 15:16:46 2015 +0200.

Description of "usb: dwc2: host: disconnect hcd prior stopping it"

The change “usb: dwc2: host: disconnect hcd prior stopping it” introduces changes as follows.

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>

Linux kernel releases containing commit 091473a

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "usb: dwc2: host: disconnect hcd prior stopping it"

There are 5 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/usb/dwc2/hcd.c | 5 +++++
 1 file changed, 5 insertions(+)
 
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;

The commit for this change in Linux stable tree is 091473a (patch).

Last modified: 2020/01/11 09:26