From 4d09515eade683996d8487160808c5515f5ecc88 Mon Sep 17 00:00:00 2001 From: lyz Date: Fri, 19 Jun 2015 19:08:44 +0800 Subject: [PATCH] usb: dwc_otg: prevent re-submit urb when disconnect detected Signed-off-by: lyz --- drivers/usb/dwc_otg_310/dwc_otg_hcd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/dwc_otg_310/dwc_otg_hcd.c b/drivers/usb/dwc_otg_310/dwc_otg_hcd.c index 4f2e7ac8a1b7..09881639192b 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_hcd.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_hcd.c @@ -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; -- 2.34.1