[PATCH] driver: gadget: fastboot: Link endpoint and descriptors
Sean Anderson
seanga2 at gmail.com
Fri Nov 5 14:29:05 CET 2021
On 11/5/21 2:28 AM, qianfan wrote:
> 在 2021/11/4 0:53, Sean Anderson 写道:
>
>> On 9/16/21 3:02 AM, qianfanguijin at 163.com wrote:
>>> From: qianfan Zhao <qianfanguijin at 163.com>
>>>
>>> If the downloading file size is equal to the partition size, "fastboot
>>> flash" can't work, at least in sunxi platform, because used an
>>> uninitalized point: ep->desc.
>>
>> Hm, I think that usb_ep_ops->enable needs to set ep->desc = desc on success.
>>
>> Of the existing drivers, only musb-new and mtu3 skip this.
>
> I checked the udc driver and found that not all the udc driver set "ep->desc = desc", such as atmel_usba_udc, dwc2_udc_otg, musb-new and mtu3. Those drivers save "desc" to bsp driver's private data only, such as "msub_ep->desc = desc", but the common usb_ep's desc is an invalid point.
>
> And I'm not find any documents declare the behaves how usb_ep_ops->enable did, save desc or not. So I'd prefect save desc in the fastboot level, and the udc driver can also save desc again if they want.
This idiom is also present in f_thor.c, f_rockusb.c, and f_mass_storage.c
Given that a majority of otg implementations set this, I think the other should be changed to match.
--Sean
More information about the U-Boot
mailing list