public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: 3090101217@zju.edu.cn
Cc: balbi@kernel.org, linux-kernel@vger.kernel.org,
	linux-usb@vger.kernel.org, pavel.hofman@ivitera.com,
	ruslan.bilovol@gmail.com, Jing Leng <jleng@ambarella.com>
Subject: Re: [PATCH v3] usb: gadget: f_uac1: add different speed transfers support
Date: Tue, 15 Feb 2022 15:08:34 +0100	[thread overview]
Message-ID: <Yguz4hOBYTXRL35t@kroah.com> (raw)
In-Reply-To: <20220215030848.5709-1-3090101217@zju.edu.cn>

On Tue, Feb 15, 2022 at 11:08:48AM +0800, 3090101217@zju.edu.cn wrote:
> From: Jing Leng <jleng@ambarella.com>
> 
> On page 61 of the UAC1 specification (
> https://www.usb.org/sites/default/files/audio10.pdf),
> bInterval is interval for polling endpoint for data transfers
> expressed in milliseconds, must be set to 1.
> 
> On page 47 of the USB2.0 specification (
> https://www.usb.org/sites/default/files/usb_20_20211008.zip),
> An isochronous endpoint must specify its required bus access period.
> Full-/high-speed endpoints must specify a desired period as
> (2^(bInterval-1)) x F, where bInterval is in the range one to
> (and including) 16 and F is 125 μs for high-speed and 1ms for full-speed.
> 
> On page 362 of the USB3.2 specification (
> https://usb.org/sites/default/files/usb_32_20210125.zip),
> The 'SuperSpeed Endpoint Companion Descriptor' shall only be
> returned by Enhanced SuperSpeed devices that are operating at Gen X speed.
> Each endpoint described in an interface is followed by a 'SuperSpeed
> Endpoint Companion Descriptor'.
> 
> Currently uac1 driver doesn't set bInterval to 1 in full speed transfer
> and doesn't have a 'SuperSpeed Endpoint Companion Descriptor' behind
> 'Standard Endpoint Descriptor'.
> 
> So we should set bInterval to 1 in full speed transfer and set it to 4
> in other speed transfers, and we should add 'SuperSpeed Endpoint Companion
> Descriptor' behind 'Standard Endpoint Descriptor' for superspeed transfer.
> 
> Signed-off-by: Jing Leng <jleng@ambarella.com>
> ---
>  drivers/usb/gadget/function/f_uac1.c | 276 ++++++++++++++++++++++-----
>  1 file changed, 225 insertions(+), 51 deletions(-)

Where is the patch version information?

> +static struct usb_ss_ep_comp_descriptor as_out_ep_desc_comp = {
> +	.bLength		= sizeof(as_out_ep_desc_comp),
> +	.bDescriptorType	= USB_DT_SS_ENDPOINT_COMP,
> +	.bMaxBurst		= 0,
> +	.bmAttributes		= 0,

Why are you setting values to 0 when you do not have to as that is the
default value?

> @@ -891,7 +1098,6 @@ static int f_audio_get_alt(struct usb_function *f, unsigned intf)
>  	return -EINVAL;
>  }
>  
> -
>  static void f_audio_disable(struct usb_function *f)
>  {
>  	struct f_uac1 *uac1 = func_to_uac1(f);

The above change is not needed here.

thanks,

greg k-h

  reply	other threads:[~2022-02-15 14:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-14  7:43 [PATCH] usb: gadget: f_uac1: add superspeed transfer support 3090101217
2022-02-14 10:38 ` Greg KH
2022-02-14 14:05   ` [PATCH v2] usb: gadget: f_uac1: add different speed transfers support 3090101217
2022-02-14 14:48     ` Greg KH
2022-02-15  3:08       ` [PATCH v3] " 3090101217
2022-02-15 14:08         ` Greg KH [this message]
2022-02-16  2:24           ` 冷静
2022-02-16 10:38             ` Greg KH
2022-02-17  5:10               ` Jing Leng
2022-02-17  5:19                 ` [PATCH v4] " 3090101217

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yguz4hOBYTXRL35t@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=3090101217@zju.edu.cn \
    --cc=balbi@kernel.org \
    --cc=jleng@ambarella.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=pavel.hofman@ivitera.com \
    --cc=ruslan.bilovol@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox