diff --git a/drivers/usb/dwc_otg_310/dwc_otg_cil.c b/drivers/usb/dwc_otg_310/dwc_otg_cil.c index dae6550634c1..411064697d37 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_cil.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_cil.c @@ -2395,6 +2395,8 @@ void dwc_otg_disable_host_interrupts(dwc_otg_core_if_t *core_if) intr_mask.b.nptxfempty = 1; DWC_MODIFY_REG32(&global_regs->gintmsk, intr_mask.d32, 0); + /* Clear pending interrupts */ + DWC_WRITE_REG32(&global_regs->gintsts, intr_mask.d32); } /** diff --git a/drivers/usb/dwc_otg_310/dwc_otg_hcd.c b/drivers/usb/dwc_otg_310/dwc_otg_hcd.c index 09881639192b..9df43cd1aba1 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_hcd.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_hcd.c @@ -480,9 +480,6 @@ void dwc_otg_hcd_stop(dwc_otg_hcd_t *hcd) pldata = hcd->core_if->otg_dev->pldata; DWC_DEBUGPL(DBG_HCD, "DWC OTG HCD STOP\n"); - /* Turn off all host-specific interrupts. */ - dwc_otg_disable_host_interrupts(hcd->core_if); - /* * Set status flags for the hub driver. */ @@ -495,6 +492,9 @@ void dwc_otg_hcd_stop(dwc_otg_hcd_t *hcd) * and the QH lists (via ..._hcd_endpoint_disable). */ DWC_SPINLOCK_IRQSAVE(hcd->lock, &flags); + /* Turn off all host-specific interrupts. */ + dwc_otg_disable_host_interrupts(hcd->core_if); + kill_all_urbs(hcd); DWC_SPINUNLOCK_IRQRESTORE(hcd->lock, flags);