From a7fe88dfdf2ddfa6b532c44baa31be2788891d39 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Fri, 19 Jun 2015 17:18:48 +0800 Subject: [PATCH] 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) --- drivers/usb/chipidea/otg_fsm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.17.1