Commit 871f38f6 authored by Felipe Balbi's avatar Felipe Balbi Committed by Kamal Mostafa

usb: musb: host: rely on port_mode to call musb_start()

commit be9d3988 upstream.

Currently, we're calling musb_start() twice for DRD ports
in some situations. This has been observed to cause enumeration
issues after suspend/resume cycles with AM335x.

In order to fix the problem, we just have to fix the check
on musb_has_gadget() so that it only returns true if
current mode is Host and ignore the fact that we have or
not a gadget driver loaded.

Fixes: ae44df2e (usb: musb: call musb_start() only once in OTG mode)
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Tested-by: default avatarSekhar Nori <nsekhar@ti.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 3f6db46f
...@@ -231,9 +231,7 @@ static int musb_has_gadget(struct musb *musb) ...@@ -231,9 +231,7 @@ static int musb_has_gadget(struct musb *musb)
#ifdef CONFIG_USB_MUSB_HOST #ifdef CONFIG_USB_MUSB_HOST
return 1; return 1;
#else #else
if (musb->port_mode == MUSB_PORT_MODE_HOST) return musb->port_mode == MUSB_PORT_MODE_HOST;
return 1;
return musb->g.dev.driver != NULL;
#endif #endif
} }
......
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