Re: [PATCH] usb: musb: am335x: Do not remove the session bin HOST-onlymode

From: Sergei Shtylyov
Date: Fri Aug 09 2013 - 16:30:34 EST


On 08/09/2013 08:03 PM, Sebastian Andrzej Siewior wrote:

This is what I observe:
On the first connect, the musb starts with DEVCTL.Session set. On
disconnect, musb_core calls try_idle. That functions removes the Session
bit signalize that the session is over (something that only in OTG is
required). A new device, that is plugged, is no longer recognized.
I've setup a timer and checked the DEVCTL register and I haven't seen a
change in VBus and I saw the B-Device bit set. After setting the IDDIG
into A mode and forcing the device to behave like I didn't see a change.
Neither VBUS goes to 0b11 nor does a session start request come.
The TI-v3.2 kernel they skip to call musb_platform_try_idle() in the
OTG_STATE_A_WAIT_BCON state while not in OTG mode.
Since the second port hast a standard A plug the patch changes the port
to run in host mode only, force the id-pin to host only and skip the
timer which would remove DEVCTL.Session.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>

diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 4ffbaac..b0752fa 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -388,6 +393,14 @@ static int dsps_musb_init(struct musb *musb)
val &= ~(1 << wrp->otg_disable);
dsps_writel(musb->ctrl_base, wrp->phy_utmi, val);

+ if (musb->port_mode == MUSB_PORT_MODE_HOST) {

Why not do the above in one line and save on {} {}? It will look more aesthetically pleasing IMHO.

+ } else {
+ }
+ dsps_writel(musb->ctrl_base, wrp->mode, val);

WBR, Sergei

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at