diff --git a/drivers/usb/dwc_otg_310/dwc_otg_cil_intr.c b/drivers/usb/dwc_otg_310/dwc_otg_cil_intr.c index 2ffba2c54d3369..0a29f41c0347c4 100644 --- a/drivers/usb/dwc_otg_310/dwc_otg_cil_intr.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_cil_intr.c @@ -1202,8 +1202,11 @@ int32_t dwc_otg_handle_usb_suspend_intr(dwc_otg_core_if_t *core_if) DWC_DEBUGPL(DBG_ANY, "disconnect?\n"); } #endif - /* PCD callback for suspend. Release the lock inside of callback function */ + /* PCD callback for suspend */ + DWC_SPINUNLOCK(core_if->lock); cil_pcd_suspend(core_if); + DWC_SPINLOCK(core_if->lock); + if (core_if->power_down == 2) { dcfg.d32 = DWC_READ_REG32(&core_if->dev_if->dev_global_regs-> diff --git a/drivers/usb/dwc_otg_310/dwc_otg_pcd.c b/drivers/usb/dwc_otg_310/dwc_otg_pcd.c index 21af8a00e9c7a8..884b77f666f5b8 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_pcd.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_pcd.c @@ -198,11 +198,8 @@ static int32_t dwc_otg_pcd_suspend_cb(void *p) { dwc_otg_pcd_t *pcd = (dwc_otg_pcd_t *) p; - if (pcd->fops->suspend) { - DWC_SPINUNLOCK(pcd->lock); + if (pcd->fops->suspend) pcd->fops->suspend(pcd); - DWC_SPINLOCK(pcd->lock); - } return 1; }