From 46f1ac72875433dcf5c409c3fa8ff019803510c6 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Fri, 27 Mar 2015 14:46:20 +0800 Subject: [PATCH] MLK-10490 usb: chipidea: otg_fsm: update b_sess_vld after changes to be b_idle In a corner case: system suspend with usb device connected on OTG port, then remove usb device and connect OTG port to PC, and then resume the system, OTG cannot be enumrated by PC. Reason is there is no BSV irq generated after resume, so b_sess_vld cannot be updated and otg fsm state keeps in b_idle state with vbus on, this patch force a update of b_sess_vld flag according to OTGSC BSV status. Acked-by: Peter Chen Signed-off-by: Li Jun (cherry picked from commit 0c1a70a95e4f8ef069e4a9809a447a39f36d0628) --- drivers/usb/chipidea/otg_fsm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index c683569cc6d7..63701d18cda5 100644 --- a/drivers/usb/chipidea/otg_fsm.c +++ b/drivers/usb/chipidea/otg_fsm.c @@ -646,6 +646,7 @@ int ci_otg_fsm_work(struct ci_hdrc *ci) if (ci->id_event) ci->id_event = false; } else if (ci->fsm.otg->state == OTG_STATE_B_IDLE) { + ci->fsm.b_sess_vld = hw_read_otgsc(ci, OTGSC_BSV); if (ci->fsm.b_sess_vld) { ci->fsm.power_up = 0; /* -- 2.17.1