nuttx/drivers/usbhost
Justin Hammond c7d6f51b9c drivers/usbhost: Stop retrying an xHCI port that will not enumerate.
xhci_enumerate() reports failure by marking the hub port disconnected,
which is what makes xhci_wait() return and the attempt repeat.  The root
port is still connected, so the two disagree again immediately and the
attempt repeats for as long as the device stays plugged in.  A device that
fails every time is retried forever: 1055 attempts in 90 seconds on an
EIC7700X board, enough console traffic to make the board unusable.

Count consecutive failures per root port and stop at
CONFIG_USBHOST_XHCI_ENUM_RETRIES, leaving the port as it is so xhci_wait()
blocks until something physically changes.  A new connection clears the
count, as does a successful enumeration, so a device needing a second
attempt still gets one.  The default of three rides out a slow device or a
marginal reset.

The same board now makes three attempts, reports that it has given up and
falls silent, while a keyboard on the other port enumerates throughout.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Justin Hammond <justin@dynam.ac>
2026-09-20 22:28:07 +08:00
..
CMakeLists.txt drivers/usbhost: Separate the xHCI driver from the PCI bus. 2026-08-18 09:35:23 -03:00
hid_parser.c
Kconfig drivers/usbhost: Stop retrying an xHCI port that will not enumerate. 2026-09-20 22:28:07 +08:00
Make.defs drivers/usbhost: Separate the xHCI driver from the PCI bus. 2026-08-18 09:35:23 -03:00
usbhost_bthci.c
usbhost_cdcacm.c
usbhost_cdcecm.c
usbhost_cdcmbim.c drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
usbhost_composite.c
usbhost_composite.h
usbhost_devaddr.c
usbhost_drivers.c
usbhost_enumerate.c usbhost: Report each device as it is enumerated. 2026-08-09 02:09:47 +08:00
usbhost_findclass.c
usbhost_ft232r.c
usbhost_hidkbd.c drivers/usbhost: Do not unregister a HID keyboard that never registered. 2026-08-09 20:57:41 +08:00
usbhost_hidmouse.c drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
usbhost_hub.c
usbhost_max3421e.c
usbhost_registerclass.c drivers/usbhost: Refuse to register the same class driver twice. 2026-08-08 14:55:34 -03:00
usbhost_registry.c
usbhost_registry.h
usbhost_skeleton.c
usbhost_storage.c drivers/usbhost: Register the partitions on a mass storage device. 2026-08-08 14:40:52 -03:00
usbhost_trace.c
usbhost_waiter.c
usbhost_xboxcontroller.c drivers/: Multiple Drivers Are Registered With World Writable - Part 2 2026-07-15 15:27:28 +08:00
usbhost_xhci.c drivers/usbhost: Stop retrying an xHCI port that will not enumerate. 2026-09-20 22:28:07 +08:00
usbhost_xhci.h drivers/usbhost: Describe devices to an xHCI controller correctly. 2026-09-20 22:28:07 +08:00
usbhost_xhci_pci.c drivers/usbhost: Separate the xHCI driver from the PCI bus. 2026-08-18 09:35:23 -03:00
usbhost_xhci_trace.c drivers/usbhost: Correct the xHCI controller name in a trace string. 2026-08-08 14:55:00 -03:00
usbhost_xhci_trace.h drivers/usbhost: Define the xHCI endpoint-allocation trace. 2026-08-08 14:55:00 -03:00