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: Wed, 20 Dec 2023 22:33:17 +0800 [thread overview]
Message-ID: <b793b44e-ce40-4f03-808a-8606970cb2e6@163.com> (raw)
In-Reply-To: <ZYHCESCO4EXPQbFY@lizhi-Precision-Tower-5810>
On 2023/12/20 00:17, Frank Li wrote:
> On Thu, Aug 03, 2023 at 05:10:49PM +0800, Linyu Yuan wrote:
>> when call uvc_function_bind(), gadget still have no connection speed,
>> just follow other gadget function, use fs endpoint descriptor to allocate
>> a video endpoint, remove gadget_is_{super|dual}speed() API call.
>>
>> Signed-off-by: Linyu Yuan <quic_linyyuan@quicinc.com>
>> ---
>> v2: no change
>>
>> drivers/usb/gadget/function/f_uvc.c | 10 +---------
>> 1 file changed, 1 insertion(+), 9 deletions(-)
>>
>> diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
>> index 5e919fb65833..c8e149f8315f 100644
>> --- a/drivers/usb/gadget/function/f_uvc.c
>> +++ b/drivers/usb/gadget/function/f_uvc.c
>> @@ -719,21 +719,13 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
>> }
>> uvc->enable_interrupt_ep = opts->enable_interrupt_ep;
>>
>> - if (gadget_is_superspeed(c->cdev->gadget))
>> - ep = usb_ep_autoconfig_ss(cdev->gadget, &uvc_ss_streaming_ep,
>> - &uvc_ss_streaming_comp);
>> - else if (gadget_is_dualspeed(cdev->gadget))
>> - ep = usb_ep_autoconfig(cdev->gadget, &uvc_hs_streaming_ep);
>> - else
>> - ep = usb_ep_autoconfig(cdev->gadget, &uvc_fs_streaming_ep);
>> -
>> + ep = usb_ep_autoconfig(cdev->gadget, &uvc_fs_streaming_ep);
> 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
with change before?
From my understanding, according to configfs gadget driver design, when find a endpoint, there is no
working speed, this means each hardware endpoint should support all possible speeds.
>
> UDC will allocate too much internal memory to each EP. It may failure when
> use ss config. Generally, ss config have bigger max package size.
is there another way to solve your issue in your driver ?
>
> Frank
>
>> if (!ep) {
>> uvcg_info(f, "Unable to allocate streaming EP\n");
>> goto error;
>> }
>> uvc->video.ep = ep;
>>
>> - uvc_fs_streaming_ep.bEndpointAddress = uvc->video.ep->address;
>> uvc_hs_streaming_ep.bEndpointAddress = uvc->video.ep->address;
>> uvc_ss_streaming_ep.bEndpointAddress = uvc->video.ep->address;
>>
>> --
>> 2.17.1
>>
next prev parent reply other threads:[~2023-12-20 14:33 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 [this message]
2023-12-20 16:02 ` Frank Li
2023-12-21 14:14 ` yuan linyu
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=b793b44e-ce40-4f03-808a-8606970cb2e6@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