Re: [PATCH 2/3] usb: gadget: f_sourcesink support for maxburst for bulk transfers
From: Alan Stern
Date: Fri Jul 04 2025 - 09:47:44 EST
On Fri, Jul 04, 2025 at 05:10:12PM +0530, Srikanth Chary Chennoju wrote:
> This patch supports bulk_maxburst. Without this change
> we are not able to achieve performance for super speed plus device.
> Without this fix, we confirmed through lecroy that it is sending
> packets with NumP always equal to 1.
>
> Signed-off-by: Srikanth Chary Chennoju <srikanth.chary-chennoju@xxxxxxx>
> ---
> drivers/usb/gadget/function/f_sourcesink.c | 14 ++++++++++++++
> drivers/usb/gadget/function/g_zero.h | 2 ++
> 2 files changed, 16 insertions(+)
>
> diff --git a/drivers/usb/gadget/function/f_sourcesink.c b/drivers/usb/gadget/function/f_sourcesink.c
> index ec5fd25020fd..84f3b3bc7669 100644
> --- a/drivers/usb/gadget/function/f_sourcesink.c
> +++ b/drivers/usb/gadget/function/f_sourcesink.c
> @@ -341,6 +346,14 @@ sourcesink_bind(struct usb_configuration *c, struct usb_function *f)
> if (!ss->out_ep)
> goto autoconf_fail;
>
> + /*
> + * Fill in the SS bulk descriptors from the module parameters.
> + * We assume that the user knows what they are doing and won't
> + * give parameters that their UDC doesn't support.
> + */
That's not such a great assumption; people make mistakes like this quite
a lot. If checking and adjusting the parameters isn't terribly
difficult, you should do it.
Alan Stern