Hi,

"McCauley, Ben" <ben.mccau...@garmin.com> 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 ?

> Signed-off-by: McCauley, Ben <ben.mccau...@garmin.com>
> ---
>
> 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;
                }
        }

> 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.

-- 
balbi

Attachment: signature.asc
Description: PGP signature

Reply via email to