summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb/musb_core.c
diff options
context:
space:
mode:
authorBin Liu2015-09-14 16:12:34 +0200
committerFelipe Balbi2015-09-14 17:14:48 +0200
commit40af177efc9385af15c49a40976f71e58e6af418 (patch)
tree60ee28428201c16fb18e6acd17d808ac1476795c /drivers/usb/musb/musb_core.c
parentusb: dwc3: omap: enable irqs lately (diff)
downloadkernel-qcow2-linux-40af177efc9385af15c49a40976f71e58e6af418.tar.gz
kernel-qcow2-linux-40af177efc9385af15c49a40976f71e58e6af418.tar.xz
kernel-qcow2-linux-40af177efc9385af15c49a40976f71e58e6af418.zip
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: Bin Liu <b-liu@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb/musb_core.c')
-rw-r--r--drivers/usb/musb/musb_core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 514a6cdaeff6..d105c6dcbbec 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -1051,6 +1051,7 @@ void musb_start(struct musb *musb)
* (c) peripheral initiates, using SRP
*/
if (musb->port_mode != MUSB_PORT_MODE_HOST &&
+ musb->xceiv->otg->state != OTG_STATE_A_WAIT_BCON &&
(devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) {
musb->is_active = 1;
} else {