[PATCH] fastboot: release usb_gadget on reboot commands

Marek Vasut marex at denx.de
Fri Jul 22 23:48:47 CEST 2022


On 7/21/22 15:59, Mattijs Korpershoek wrote:

[...]

> diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
> index 8ba55aab9f8f..a00d1ca571d1 100644
> --- a/drivers/usb/gadget/f_fastboot.c
> +++ b/drivers/usb/gadget/f_fastboot.c
> @@ -420,7 +420,8 @@ static int fastboot_tx_write_str(const char *buffer)
>   
>   static void compl_do_reset(struct usb_ep *ep, struct usb_request *req)
>   {
> -	do_reset(NULL, 0, 0, NULL);
> +	g_dnl_trigger_detach();
> +	g_dnl_trigger_reset_request();

Wouldn't it be enough to call usb_gadget_release() before do_reset() 
here ? Or actually fix up the hardware state in your platform reset 
implementation, which would cover all such odd states for every other 
USB UDC mode of operation, not just fastboot ?


More information about the U-Boot mailing list