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 Gupta,

2010/5/18 Gupta, Ajay Kumar <ajay.gupta@xxxxxx>:
> 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.

No, see section 8.5.1 NAK Limiting via Ping Flow Control of usb 2.0 spec:

          Control endpoints must support this protocol for an OUT transaction
          in the data and status stages. The control Setup stage must
not support
          the PING protocol.

>
> --------------
> 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;
> --------------
>
> Can you try this and see if this fixes issue for your device.
>
> -Ajay
>>
>> > >-----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
>



-- 
Lei Ming
--
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