mirror of
https://github.com/apache/nuttx.git
synced 2026-10-01 11:26:29 +00:00
A device slot is a finite controller resource: HCSPARAMS1 reports how many exist and Enable Slot fails with No Slots Available once they are gone. Two paths took one and returned without giving it back. xhci_device_init() enables a slot before initialising the transfer ring, the slot context and the device address, and each of those returned directly on failure. It also treated a slot number larger than the controller supports as success, since Enable Slot itself had succeeded. xhci_enumerate() is the larger leak: the device is addressed by the time usbhost_enumerate() runs, so a device whose descriptor cannot be read, or that no class driver claims, leaves the slot held. That path clears hport->connected so the port is retried, taking another slot each time. Release the slot on both paths with xhci_device_deinit(), which issues Disable Slot, clears the DCBAA entry and resets the context. The endpoint ring is left allocated; xhci_ring_init() reuses an existing one. Tested on an EIC7700X board with a device no class driver claims, so the port retries indefinitely: previously the eighth attempt failed with completion code 9 and the controller enumerated nothing further on either port; now 1104 consecutive attempts produced no slot failure. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <justin@dynam.ac> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| hid_parser.c | ||
| Kconfig | ||
| Make.defs | ||
| usbhost_bthci.c | ||
| usbhost_cdcacm.c | ||
| usbhost_cdcecm.c | ||
| usbhost_cdcmbim.c | ||
| usbhost_composite.c | ||
| usbhost_composite.h | ||
| usbhost_devaddr.c | ||
| usbhost_drivers.c | ||
| usbhost_enumerate.c | ||
| usbhost_findclass.c | ||
| usbhost_ft232r.c | ||
| usbhost_hidkbd.c | ||
| usbhost_hidmouse.c | ||
| usbhost_hub.c | ||
| usbhost_max3421e.c | ||
| usbhost_registerclass.c | ||
| usbhost_registry.c | ||
| usbhost_registry.h | ||
| usbhost_skeleton.c | ||
| usbhost_storage.c | ||
| usbhost_trace.c | ||
| usbhost_waiter.c | ||
| usbhost_xboxcontroller.c | ||
| usbhost_xhci.c | ||
| usbhost_xhci.h | ||
| usbhost_xhci_pci.c | ||
| usbhost_xhci_trace.c | ||
| usbhost_xhci_trace.h | ||