From: Li Jun Date: Fri, 19 Jun 2015 09:18:48 +0000 (+0800) Subject: MLK-11132 usb: chipidea: otg: delay suspend for a_wait_vfall X-Git-Tag: C0P2-H0.0--20200415~4632 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=a7fe88dfdf2ddfa6b532c44baa31be2788891d39;p=linux.git MLK-11132 usb: chipidea: otg: delay suspend for a_wait_vfall While A device as peripheral ends session by a_bus_drop, it will go back to host role by transition to a_wait_vfall state, then ehci host driver may access portsc status after controller enters suspend , this will result in system hang since its clock is gated off. This patch use existing autosuspend to delay the controller suspend if it comes to a_wait_vfall state. Signed-off-by: Li Jun (cherry picked from commit b140fa6803ef6ececec17e435212a960a3169cc2) --- diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index 170faa46277b..cfbb82ff57b0 100644 --- a/drivers/usb/chipidea/otg_fsm.c +++ b/drivers/usb/chipidea/otg_fsm.c @@ -711,7 +711,8 @@ int ci_otg_fsm_work(struct ci_hdrc *ci) */ ci_otg_queue_work(ci); } - } else if (ci->fsm.otg->state == OTG_STATE_A_HOST) { + } else if (ci->fsm.otg->state == OTG_STATE_A_HOST || + ci->fsm.otg->state == OTG_STATE_A_WAIT_VFALL) { pm_runtime_mark_last_busy(ci->dev); pm_runtime_put_autosuspend(ci->dev); return 0;