[PATCH v2 1/2] usb: gadget: fastboot: detach usb on reboot commands
Marek Vasut
marex at denx.de
Mon Oct 10 18:08:50 CEST 2022
On 10/7/22 11:38, Mattijs Korpershoek wrote:
> When host issues "fastboot reboot fastboot", it's expected that the
> board drops the USB connection before resetting.
>
> On some boards, such as Khadas VIM3L and SEI610, this is not the case.
>
> We observe the following error:
> $ fastboot reboot fastboot
> Rebooting into fastboot OKAY [ 0.004s]
> fastboot: error: Failed to boot into userspace fastboot; one or more components might be unbootable.
>
> This does not happen when we use the RST button on the board.
> It can be reproduced in linux with:
> # echo b > /proc/sysrq-trigger
>
> In this case, we hit a undefined hardware behavior, where D+ and D-
> are in an unknown state. Therefore the host can't detect usb
> disconnection.
>
> Make sure we always call usb_gadget_release() when a "fastboot reboot"
> command is issued.
>
> Note: usb_gadget_release() should be called before g_dnl_unregister()
> because g_dnl_unregister() triggers a complete() call on each
> endpoint (thus calling do_reset()).
Applied to usb/master , thanks
More information about the U-Boot
mailing list