git: 1069b3b51421 - stable/13 - usb(4): Make sure the enumeration thread doesn't loop too fast.

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Wed, 12 Oct 2022 15:54:22 UTC
The branch stable/13 has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=1069b3b514219b0619a6c18b456b379f8aed5910

commit 1069b3b514219b0619a6c18b456b379f8aed5910
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-06-09 13:15:49 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-10-12 15:53:22 +0000

    usb(4): Make sure the enumeration thread doesn't loop too fast.
    
    Sponsored by:   NVIDIA Networking
    
    (cherry picked from commit 55a3bd000d9799f431c207e359466484ac63c137)
---
 sys/dev/usb/controller/usb_controller.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c
index fd9bcd5ee524..8705c2849e4e 100644
--- a/sys/dev/usb/controller/usb_controller.c
+++ b/sys/dev/usb/controller/usb_controller.c
@@ -416,6 +416,9 @@ usb_bus_explore(struct usb_proc_msg *pm)
 #if USB_HAVE_ROOT_MOUNT_HOLD
 	usb_root_mount_rel(bus);
 #endif
+
+	/* Nice the enumeration a bit, to avoid looping too fast. */
+	usb_pause_mtx(&bus->bus_mtx, USB_MS_TO_TICKS(16));
 }
 
 /*------------------------------------------------------------------------*