RE: [Uclinux-dist-devel] [PATCH] USB: musb: set NAK limitation for control transfers

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

 



Hi,
> -----Original Message-----
> From: Cliff Cai [mailto:cliffcai.sh@xxxxxxxxx]
> Sent: Tuesday, May 18, 2010 1:51 PM
> To: Gupta, Ajay Kumar
> Cc: Cai, Cliff; linux-usb@xxxxxxxxxxxxxxx; Mike Frysinger; Felipe Balbi;
> uclinux-dist-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [Uclinux-dist-devel] [PATCH] USB: musb: set NAK limitation
> for control transfers
> 
> On Tue, May 18, 2010 at 2:00 PM, Gupta, Ajay Kumar <ajay.gupta@xxxxxx>
> wrote:
> > Hi,
> >> > Dose this patch work for you?
> >> > I tried several different values,and
> >> > It seems that '8' work just fine.
> >> Yes, it works for me.
> >>
> >> I was just thinking of setting limit values based on device speed
> >> so that timeout value in terms of msec is same for all devices.
> >> For HS devices = 8, and for FS/LS devices = 5 for timeout of 16msec.
> >>
> >> - interval = 8;
> >> + interval = (USB_SPEED_HIGH == urb->dev->speed) ? 8 : 5;
> >
> > Another fix (I think a better one) is to disable PING on status phase
> > only, which is allowed as per USB specification.
> >
> > --------------
> > diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
> > index 83f482e..f1a3ca7 100644
> > --- a/drivers/usb/musb/musb_host.c
> > +++ b/drivers/usb/musb/musb_host.c
> > @@ -1068,6 +1068,8 @@ irqreturn_t musb_h_ep0_irq(struct musb *musb)
> >                        else
> >                                csr = MUSB_CSR0_H_STATUSPKT
> >                                        | MUSB_CSR0_TXPKTRDY;
> > +                       /* disable ping token in status phase */
> > +                               csr |= MUSB_CSR0_H_DIS_PING;
> >
> >                        /* flag status stage */
> >                        musb->ep0_stage = MUSB_EP0_STATUS;
> > --------------
> 
> 
> I got endless massages: "musb_h_ep0_irq 1053: no URB for end 0" with this
> patch.
Then your device doesn't seem to have PING issue. I also noticed this error
message two times with your fix.

> also I think disabling PING for all devices doesn't make sense.

It's only for control endpoint and in status phase alone.

> 
> while "interval = (USB_SPEED_HIGH == urb->dev->speed) ? 8 : 5;"
> works for me.

I think this should be fine to go.

> 
> Thanks
> 
> Cliff
> 
> >>
> >> > >-----Original Message-----
> >> > >From: Mike Frysinger [mailto:vapier.adi@xxxxxxxxx]
> >> > >Sent: Sunday, May 16, 2010 8:47 AM
> >> > >To: Gupta, Ajay Kumar
> >> > >Cc: linux-usb@xxxxxxxxxxxxxxx; Felipe Balbi;
> >> > >uclinux-dist-devel@xxxxxxxxxxxxxxxxxxxx; Cai, Cliff
> >> > >Subject: Re: [Uclinux-dist-devel] [PATCH] USB: musb: set NAK
> >> > >limitation for control transfers
> >> > >
> >> > >On Fri, May 14, 2010 at 01:42, Gupta, Ajay Kumar wrote:
> >> > >>> Some bad-behaved peripherals (like cheap USB storage devices)
> need
> >> > >>> this in order to recover during configuration time.
> >> > >>>
> >> > >>> diff --git a/drivers/usb/musb/musb_host.c
> >> > >>> b/drivers/usb/musb/musb_host.c index 877d20b..e2667dc 100644
> >> > >>> --- a/drivers/usb/musb/musb_host.c
> >> > >>> +++ b/drivers/usb/musb/musb_host.c
> >> > >>> @@ -1994,6 +1994,9 @@ static int musb_urb_enqueue(
> >> > >>>               /* ISO always uses logarithmic encoding */
> >> > >>>               interval = min_t(u8, epd->bInterval, 16);
> >> > >>>               break;
> >> > >>> +     case USB_ENDPOINT_XFER_CONTROL:
> >> > >>> +             interval = 8;
> >> > >>
> >> > >> Why '8'? Device could be high speed or FS/LS so it comes out to,
> HS
> >> > >> device: 2^7 uf = 128uf = 16 msec FS/LS device: 2^7 f = 128msec
> >> > >
> >> > >it's a value that seems to work in our tests.  i'm pretty sure
> >> > >we arent tied to a specific value, so if you want to increase
> >> > >it, that's fine.  Cliff can certainly correct me though.
> >> > >
> >> > >> Also, I have seen high speed bad behaved devices not responding to
> >> > >> PING tokens in status phase of control transfers. Are you
> >> > >also getting
> >> > >> this issue ?
> >> > >
> >> > >yes, we had PING problems, and we've posted other patches in
> >> > >the past for that, but this seems to be the most correct
> >> > >version so far.
> >> > >
> >> > >search for like blackfin+ping+musb on some lists if you're
> >> > >interested in the history.
> >> > >-mike
> >> > >
> >> --
> >> 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
> > --
> > 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
> >
--
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