RE: [PATCH] USB: DCW3: GADGET: Set Correct Max Speed

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

 



Hi,

"McCauley, Ben" <Ben.McCauley@xxxxxxxxxx> writes:
> Felipe,
>
>  -----Original Message-----
>  From: Felipe Balbi [mailto:balbi@xxxxxx]
>  Sent: Friday, November 06, 2015 10:06 AM
>  To: McCauley, Ben <Ben.McCauley@xxxxxxxxxx>
>  Cc: linux-usb@xxxxxxxxxxxxxxx; Schroeder, Jay <Jay.Schroeder@xxxxxxxxxx>
> Subject: Re: [PATCH] USB: DCW3: GADGET: Set Correct Max Speed
>>
>>
>> Hi,
>>
>> "McCauley, Ben" <Ben.McCauley@xxxxxxxxxx> writes:
>> > The max speed was always being set to USB_SUPER_SPEED even when the
>> > phy was only capable of HIGH_SPEED. This
>>
>> this statement is untrue
>>
>> > uses the value set for the phy to set the max for the gadget. It
>> > resolves an issue with Window PCs where they report that using a
>> > USB3.0 port would result in better performance even when connecting
>> > through a 3.0 port.
>>
>> man, who gave you this kernel ? Which kernel version are you using ?
>> Have you even tested mainline ?
>
> This Kernel is from http://omapzoom.org/?p=kernel/omap.git;a=shortlog;h=refs/heads/p-ti-linux-3.14.y-common
> at branch  "development/omapzoom/glsdk-7.-2.00.02".
> I have not tested it on main line.

seems like you should be talking to your FAE or using TI's e2e forum for
this.

>> > Signed-off-by: McCauley, Ben <ben.mccauley@xxxxxxxxxx>
>> > ---
>> >
>> > diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
>> > index 1eaf31c..0a388e3 100644
>> > --- a/drivers/usb/dwc3/gadget.c
>> > +++ b/drivers/usb/dwc3/gadget.c
>> > @@ -2899,7 +2899,7 @@
>>
>> which kernel are you using ? This file is 2868 lines, so you're patching outside
>> the file.
>>
>> >         }
>> >
>> >         dwc->gadget.ops                 = &dwc3_gadget_ops;
>> > -       dwc->gadget.max_speed           = USB_SPEED_SUPER;
>> > +       dwc->gadget.max_speed           = dwc->maximum_speed;
>>
>> this is corrected at dwc3_gadget_start():

and I see that in that kernel, this is corrected at
dwc3_gadget_restart() instead.

>>       /**
>>        * WORKAROUND: DWC3 revision < 2.20a have an issue
>>        * which would cause metastability state on Run/Stop
>>        * bit if we try to force the IP to USB2-only mode.
>>        *
>>        * Because of that, we cannot configure the IP to any
>>        * speed other than the SuperSpeed
>>        *
>>        * Refers to:
>>        *
>>        * STAR#9000525659: Clock Domain Crossing on DCTL in
>>        * USB 2.0 Mode
>>        */
>>       if (dwc->revision < DWC3_REVISION_220A) {
>>               reg |= DWC3_DCFG_SUPERSPEED;
>>       } else {
>>               switch (dwc->maximum_speed) {
>>               case USB_SPEED_LOW:
>>                       reg |= DWC3_DSTS_LOWSPEED;
>>                       break;
>>               case USB_SPEED_FULL:
>>                       reg |= DWC3_DSTS_FULLSPEED1;
>>                       break;
>>               case USB_SPEED_HIGH:
>>                       reg |= DWC3_DSTS_HIGHSPEED;
>>                       break;
>>               case USB_SPEED_SUPER:   /* FALLTHROUGH */
>>               case USB_SPEED_UNKNOWN: /* FALTHROUGH */
>>               default:
>>                       reg |= DWC3_DSTS_SUPERSPEED;
>>               }
>>       }
>>
>
> I am on 3.14 LTS though even on 4.3 I do not see dwc->gadget.max_speed
> being updated to reflect the actual max speed as set in
> drivers/usb/dwc3/core.c [dwc3_probe()]. dwc->gadget.max_speed is used
> in a number of locations to determine what response is sent to the
> host.
>
> dwc3_gadget_start() only appears to set the max speed to the register
> and not update the gadget.

but the IP _is_ super-speed capable. Max speed should only be used to
determine if $this gadget can run with $this controller; speed, instead,
is used for all sorts of different things and _that_ is updated on
Connection Done IRQ.

Can you point one place where you think it's wrong ? And, please, refer
to mainline code. We can't support a v3.14 kernel which might contain a
ton of additions which are not in mainline (for example, mainline
doesn't have a dwc3_gadget_restart() function).

-- 
balbi

Attachment: signature.asc
Description: PGP signature


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

  Powered by Linux