Commit 40af177e authored by Bin Liu's avatar Bin Liu Committed by Felipe Balbi

usb: musb: ensure in peripheral mode when checking session

The change ensures otg is not in a A- state when checking for VBUS in
peripheral mode.

musb_start() where VBUS checking is in can be called in many situations.
One example is in babble recovery routine, in which otg is transitioning
from A-HOST to A-WAIT-BCON, but VBUS discharge takes time, so
musb->is_active could be set to 1 due to this improper checking, then it
causes musb_bus_suspend() failed which leads to warning log message
flooding.
Signed-off-by: default avatarBin Liu <b-liu@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent e2ae0692
...@@ -1051,6 +1051,7 @@ void musb_start(struct musb *musb) ...@@ -1051,6 +1051,7 @@ void musb_start(struct musb *musb)
* (c) peripheral initiates, using SRP * (c) peripheral initiates, using SRP
*/ */
if (musb->port_mode != MUSB_PORT_MODE_HOST && if (musb->port_mode != MUSB_PORT_MODE_HOST &&
musb->xceiv->otg->state != OTG_STATE_A_WAIT_BCON &&
(devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) { (devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) {
musb->is_active = 1; musb->is_active = 1;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment