From: yuan linyu <cugyly@163.com>
To: Frank Li <Frank.li@nxp.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2 3/7] usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()
Date: Thu, 21 Dec 2023 22:14:16 +0800 [thread overview]
Message-ID: <74e0092a-f084-4e87-8d83-df27fb5a0290@163.com> (raw)
In-Reply-To: <ZYMQDVU+c+gEQjE9@lizhi-Precision-Tower-5810>
On 2023/12/21 00:02, Frank Li wrote:
>>> Some UDC driver use gadget_check_config() and match_ep() to allocate EP
>>> internal fifo memory resource, if only pass download full speed EP.
>> Could you share the detail of problem ? do you mean find another different endpoint compared
> The problem is little bit complex. I try to use simple words.
>
> The background:
>
> Generally, UDC have some EP<0..15> and have some internal memory as FIFO.
> for example 16K. You can simple assign EP<n> to 1K memory, which can hold
> whole package.
>
> But for UVC, some controller required internal FIFO hold whole frame data
>
> (mult+1) * (MaxBurst +1) * wPackageSize.
>
> For most case, not every gadget use all 16 EPs. So you can assgin more
> memory into one EP, so it will reduce bus 'ping' package number and reduce
> NACK to improve transfer speed.
>
> The problem:
> pass fs_stream to udc driver, udc driver's check_config function will see
> mult and maxburst is 0. so only reserve 1K for ISO EP, but when try to
> enable EP, mult is 2, so there are not enough internal memory for it
> because more memory already assign to other EPs.
>
> Ideally, when gadget frame work can call check_config again when know
> usb speed, but it is not easy to fix it.
>
> Simple method use ss_stream_ep here and other function drviers. Super
> speed's package size is bigger than high/full speed. If resource can
> support super speed, it can support high/full speed.
I don't find any difference of uvc_ss_streaming_ep, uvc_hs_streaming_ep, uvc_fs_streaming_ep
descriptors. how difference happen in UDC ?
>
>
> /**
> * gadget_is_superspeed() - return true if the hardware handles superspeed
> * @g: controller that might support superspeed
> */
>
> @max_speed: Highest speed the driver handles
>
> And according to gadget_is_superspeed() define, it indicate if udc
> controller support supersped, not link speed.
>
> Orignial code is correct. If UDC support superspeed, then use ss_stream_ep.
>
> becasue superspeed is worse case compared as high and full speed.
>
> So I think original is correct.
>
> Frank.
>
>
next prev parent reply other threads:[~2023-12-21 14:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-03 9:10 [PATCH v2 0/7] remove some usage of gadget_is_{*}speed() API Linyu Yuan
2023-08-03 9:10 ` [PATCH v2 1/7] usb: gadget: use working speed to calcaulate network bitrate and qlen Linyu Yuan
2023-08-03 9:10 ` [PATCH v2 2/7] usb: gadget: add a inline function gether_bitrate() Linyu Yuan
2023-08-03 9:10 ` [PATCH v2 3/7] usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind() Linyu Yuan
2023-12-19 16:17 ` Frank Li
2023-12-20 14:33 ` yuan linyu
2023-12-20 16:02 ` Frank Li
2023-12-21 14:14 ` yuan linyu [this message]
2023-12-21 14:57 ` Frank Li
2023-08-03 9:10 ` [PATCH v2 4/7] usb: gadget: unconditionally allocate hs/ss descriptor in bind operation Linyu Yuan
2023-08-03 9:10 ` [PATCH v2 5/7] usb: gadget: config: remove max speed check in usb_assign_descriptors() Linyu Yuan
2023-08-03 9:10 ` [PATCH v2 6/7] usb: gadget: composite: cleanup function config_ep_by_speed_and_alt() Linyu Yuan
2023-08-03 9:10 ` [PATCH v2 7/7] usb: gadget: remove max support speed info in bind operation Linyu Yuan
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=74e0092a-f084-4e87-8d83-df27fb5a0290@163.com \
--to=cugyly@163.com \
--cc=Frank.li@nxp.com \
--cc=linux-usb@vger.kernel.org \
/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