[PATCH 1/2] usb: ci_udc: Check ci_ep->desc before use
Mattijs Korpershoek
mkorpershoek at kernel.org
Mon Dec 1 10:15:15 CET 2025
On Mon, Dec 01, 2025 at 09:20, Petr Benes <petr.benes at ysoft.com> wrote:
>>>
>>> Which are held in (struct ci_drv).ep[] and the problematic code is
>>> ci_udc specific.
>>
>> Ok.
>>
>> I have compared the changes with the linux driver
>> (drivers/usb/chipidea/udc.c) and see a couple of differences in error
>> handling
>>
>> For example, in linux, in ep_disable(), we return -EBUSY instead of 0.
>>
>> 0 seems to tell the caller that we sucesfully disabled an ep but we did
>> not do anything since it was already disabled.
>
> Fair.>
>> Can we do the same error handling as in the linux driver ?
>
> Sure. -EBUSY seems to used mainly by *_register_driver(), I'll test it
> and return with the updated patch.>
Thank you. Please also make sure to look at ep_enable() in linux as a
similar pattern is found in this U-Boot patch.
(we return 0 instead of a negative error code)
>>>
>>>>
>>>>>
>>>>> Moreover, the patch gets rid of possible outstanding requests if the
>>>>> endpoint's state changes to disabled.
>>>>>
>>>>> Signed-off-by: Petr Beneš <petr.benes at ysoft.com>
>>>>> Signed-off-by: Michal Vokáč <michal.vokac at ysoft.com>
>>>>> ---
More information about the U-Boot
mailing list