RE: [PATCH] usb:musb: Fix for Full Speed issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> -----Original Message-----
> From: Sergei Shtylyov [mailto:sshtylyov@xxxxxxxxxx]
> Sent: Thursday, July 26, 2012 5:55 PM
> To: Ajay M JAWADE
> Cc: linux-usb@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH] usb:musb: Fix for Full Speed issue
> 
> Hello.
> 
> On 26-07-2012 10:03, Ajay M JAWADE wrote:
> 
> > After sending the USB Bus reset, Host waits for High Speed Chirps.
> > If the soft-disconnect and soft-connect happens during this chirp
> > time, then Host doesn't detect this disconnect.
> 
>     Why talk about soft-connect when we're already connected (as USB reset
> is in progress) and further you talk about disconnect only?
> 

Soft-disconnect and soft-connect is done to prepare the new USB descriptors.
As Host was waiting for high speed chirps, it doesn't detect the disconnect and connect.

> > Host treats this as Full Speed Device as there are no chirps.
> > To avoid this Full Speed Enumeration, soft-disconnect and soft-connect
> > should have a 500 mili-second gap when USB cable is connected.
> 
> > Signed-off-by: Ajay Jawade <ajay.jawade@xxxxxxxxxxxxxx>
> > Acked-by: srinidhi kasagar <srinidhi.kasagar@xxxxxxxxxxxxxx>
> > ---
> >   drivers/usb/musb/musb_gadget.c |   26
> ++++++++++++++++++++++++++
> >   1 files changed, 26 insertions(+), 0 deletions(-)
> 
> > diff --git a/drivers/usb/musb/musb_gadget.c
> > b/drivers/usb/musb/musb_gadget.c index f7194cf..801dbe6 100644
> > --- a/drivers/usb/musb/musb_gadget.c
> > +++ b/drivers/usb/musb/musb_gadget.c
> [...]
> > @@ -1751,6 +1752,31 @@ static int musb_gadget_pullup(struct
> usb_gadget *gadget, int is_on)
> >   	/* NOTE: this assumes we are sensing vbus; we'd rather
> >   	 * not pullup unless the B-session is active.
> >   	 */
> > +
> > +	/* After sending the USB Bus reset, Host waits for
> > +	 * High Speed Chirps. If the soft-disconnect and soft-connect
> > +	 * happens during this chirp time, then Host doesn't
> > +	 * detect this disconnect. Host treats this as Full Speed
> > +	 * Device as there are no chirps. To avoid this Full Speed
> > +	 * Enumeration, soft-disconnect and soft-connect should have
> > +	 * a 500 mili-second delay when USB cable is connected.
> 
>     s/mili-second/millisecond/
> 
> > +	 */
> > +
> 
>     Empty line not needed here.
> 
> > +	if (is_on && (is_on != musb->softconnect)) {
> > +
> > +		/* USB cable presence is decided by reading the VBUS
> > +		 * Level bits of DevCtl register.
> > +		 */
> > +
> 
>     Here too.
> 
> > +		devctl = musb_readb(musb->mregs, MUSB_DEVCTL);
> > +		devctl = (devctl & MUSB_DEVCTL_VBUS) >>
> MUSB_DEVCTL_VBUS_SHIFT;
> > +
> 
>     And here too.
> 
> > +		if (devctl != 0) {
> > +			/* USB Cable is connected. Delay the soft-connect */
> 
>     s/connected/powered/?
> 
> > +			msleep(500);
> > +		}
> > +	}
> > +
> 
> WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux