Hi Steve,

Can you test this patch?

I made a slight variant which delay the explore threads instead of the main thread running all the sysinits.

--HPS
Index: sys/dev/usb/controller/usb_controller.c
===================================================================
--- sys/dev/usb/controller/usb_controller.c	(revision 349802)
+++ sys/dev/usb/controller/usb_controller.c	(working copy)
@@ -105,6 +105,10 @@
 SYSCTL_INT(_hw_usb, OID_AUTO, no_shutdown_wait, CTLFLAG_RWTUN,
     &usb_no_shutdown_wait, 0, "No USB device waiting at system shutdown.");
 
+static int usb_explore_wait = 250;
+SYSCTL_INT(_hw_usb, OID_AUTO, explore_wait, CTLFLAG_RWTUN,
+    &usb_explore_wait, 0, "Delay in milliseconds between initial root HUB explore.");
+
 static devclass_t usb_devclass;
 
 static device_method_t usb_methods[] = {
@@ -373,6 +377,13 @@
 	if (bus->no_explore != 0)
 		return;
 
+	if (bus->explore_delay == 0) {
+		int ms = device_get_unit(bus->bdev) * usb_explore_wait;
+		bus->explore_delay = 1;
+		if (ms != 0)
+			usb_pause_mtx(&bus->bus_mtx, howmany(ms * hz, 1000));
+	}
+
 	if (udev != NULL) {
 		USB_BUS_UNLOCK(bus);
 		uhub_explore_handle_re_enumerate(udev);
Index: sys/dev/usb/usb_bus.h
===================================================================
--- sys/dev/usb/usb_bus.h	(revision 349802)
+++ sys/dev/usb/usb_bus.h	(working copy)
@@ -131,6 +131,7 @@
 	uint8_t	do_probe;		/* set if USB should be re-probed */
 	uint8_t no_explore;		/* don't explore USB ports */
 	uint8_t dma_bits;		/* number of DMA address lines */
+	uint8_t explore_delay;		/* set if USB explore did initial delay */
 };
 
 #endif					/* _USB_BUS_H_ */
_______________________________________________
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Reply via email to