From 8c29b73278d66c029b98caecba81831ef6dc472a Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 5 May 2023 20:03:04 -0600 Subject: bootstd: usb: Avoid initing USB twice This causes crashes on some boards, e.g. rockpro64. In any case, we should not do it. Check the usb_started flag to avoid this. Signed-off-by: Simon Glass Tested-by: Jonas Karlman Tested-by: Tom Rini --- drivers/usb/host/usb_bootdev.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/usb/host/usb_bootdev.c') diff --git a/drivers/usb/host/usb_bootdev.c b/drivers/usb/host/usb_bootdev.c index 32919f99286..06e8f61aa1c 100644 --- a/drivers/usb/host/usb_bootdev.c +++ b/drivers/usb/host/usb_bootdev.c @@ -22,6 +22,9 @@ static int usb_bootdev_bind(struct udevice *dev) static int usb_bootdev_hunt(struct bootdev_hunter *info, bool show) { + if (usb_started) + return 0; + return usb_init(); } -- cgit v1.2.3