FROMLIST: usb: Avoid unbinding devices in use by bootflows

When a USB device is unbound, it causes any bootflows attached to it to
be removed, via a call to bootdev_clear_bootflows() from
bootdev_pre_unbind(). This obviously makes it impossible to boot the
bootflow.

However, when booting a bootflow that relies on USB, usb_stop() is
called, which unbinds the device. For EFI, this happens in
efi_exit_boot_services() which means that the bootflow disappears
before it is finished with.

There is no need to unbind all the USB devices just to quiesce them.
Add a new usb_pause() call which removes them but leaves them bound.

This resolves a hang on x86 when booting a distro from USB. This was
found using a device with 4 bootflows, the last of which was USB.

BUG=b:301472320
TEST=with previous CLs, instead Ubuntu 2023.04 into USB-A port on
felwinter; boot into altfw and select the last entry to boot; see that
Ubuntu boots correctly

Change-Id: If206027372f73ce32480223e5626f4b944e281b7
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/u-boot/+/4888653
Reviewed-by: Karthikeyan Ramasubramanian <kramasub@google.com>
4 files changed