From f1afb4f7be9c30b93b69bb72826a61e991ea1d36 Mon Sep 17 00:00:00 2001 From: Chong Qiao Date: Wed, 30 Sep 2020 15:21:00 +0800 Subject: [PATCH] pmon usb rescan retry only twice. Change-Id: I2a8fd672ae533a5d84620d2d99cc9aeb993d6fa7 Signed-off-by: Chong Qiao --- sys/dev/usb/usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c index d3e44de1..3e0b9c89 100644 --- a/sys/dev/usb/usb.c +++ b/sys/dev/usb/usb.c @@ -1854,6 +1854,7 @@ int usb_hub_configure(struct usb_device *dev) int i; struct usb_hub_device *hub; struct usb_hc *hc = dev->hc_private; + int retry = 2; /* "allocate" Hub device */ hub=usb_hub_allocate(); @@ -1998,7 +1999,7 @@ int usb_hub_configure(struct usb_device *dev) usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_C_RESET); } } /* end for i all ports */ - } while (hub_port_need_rescan); + } while (hub_port_need_rescan && --retry); return 0; }