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

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

 



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.

>
> > 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():
>
>       /**
>        * 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.


> > CONFIDENTIALITY NOTICE: This email and any attachments are for the
> > sole use of the intended recipient(s) and contain information that may
> > be confidential and/or legally privileged. If you have received this
> > email in error, please notify the sender by reply email and delete the
> > message. Any disclosure, copying, distribution or use of this
> > communication (including attachments) by someone other than the
> > intended recipient is prohibited. Thank you.
>
> when sending emails to a public mailing list, you should make sure to drop
> these sort of notices. The content of the email *must* be public.
>

Thanks for pointing that out I will work to get it removed in the future.

> --
> balbi

-Ben

________________________________

CONFIDENTIALITY NOTICE: This email and any attachments are for the sole use of the intended recipient(s) and contain information that may be confidential and/or legally privileged. If you have received this email in error, please notify the sender by reply email and delete the message. Any disclosure, copying, distribution or use of this communication (including attachments) by someone other than the intended recipient is prohibited. Thank you.
--
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