USB3 xhci driver device count limitation

We use a lot of usb devices in a TX2 based system, it appears the xhci-tegra driver suffers from the same limit as the intel implementation did where more than 20 devices and no more are allowed.

http://marc.merlins.org/perso/linux/post_2018-12-20_Getting-Around-USB3-xhci-32-Device-Limit-Max-number-of-devices-this-xHCI-host-supports-is-32.html

With the below I’m very close and if I plug in over 20 devices, then follow on devices fail to enumerate.

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-tegra/3p, 5000M
    |__ Port 2: Dev 2, If 0, Class=Hub, Driver=hub/7p, 5000M
        |__ Port 6: Dev 3, If 0, Class=Vendor Specific Class, Driver=lan78xx, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-tegra/4p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 4: Dev 4, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 3: Dev 7, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 6, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 2: Dev 18, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 17, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 4: Dev 8, If 0, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 4: Dev 8, If 1, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 4: Dev 8, If 2, Class=Audio, Driver=snd-usb-audio, 12M
        |__ Port 4: Dev 8, If 3, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 3: Dev 5, If 0, Class=Hub, Driver=hub/7p, 480M
        |__ Port 5: Dev 11, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 1: Dev 19, If 0, Class=(Defined at Interface level), Driver=, 12M
            |__ Port 2: Dev 20, If 0, Class=Vendor Specific Class, Driver=dvb_usb_it913x, 480M
            |__ Port 3: Dev 21, If 0, Class=Vendor Specific Class, Driver=usb-it951x, 480M
            |__ Port 4: Dev 22, If 0, Class=Vendor Specific Class, Driver=usb-it951x, 480M

Is there some work to be done somewhere that would allow more devices other than enabling more USB3 roots? or is there only one root controller anyway and the multiple USB3 ports are only off that one root?

Hi,
There is a hardware limitation: EP(end point) <= 70, i.e., SS+HS+FS+LS EPs <= 70.

Is this a limitation in software or of the root controller in the tegra itself? It seems in this case it is a little unusual since I have 4 devices with 4 endpoint and 2 with 5, so we’ve eaten up that limit rapidly with other usb devices, including our own. if necessary can we hang another root controller from the PCI and circumvent this issue? In some past iterations of our controller using windows/winCE we’ve had as many as 64 devices (128-192 endpoints), not including any mouse/keyboard, external USB, etc.

Right now I have it working with 67 endpoints (a bit of overkill), but when the system boots some of the devices fail to enumerate because the hub bandwidth limit is exceeded. But if I plug the devices in in different topology, hanging different devices off different ports, instead I get some devices failing to enumerate with ‘unexpected setup command completion error xx’, while the previous devices that didn’t have enough bandwidth do enumerate.

I imagine some of this is linux issues as well.

Hi,
It is limitation of xhci controller. You may extend it by using PCIe to USB adapter, but please note there can also be EP limitation on the adapter.