shenki / exar-uart-driver

Linux kernel driver for the Exar xr21v141x "vizzini" UART
GNU General Public License v2.0
10 stars 8 forks source link

Unable to use more than 32 XR21v14x ttyUSB devices #2

Open condemil opened 10 years ago

condemil commented 10 years ago

When I tried to connect more than 32 XR21v14x ttyUSB devices I get driver limitation:

Aug 17 14:24:52 stand1 kernel: [360766.866258] vizzini 1-4.2.4:1.6: ttyUSB31: XR21v14x usb uart device
Aug 17 14:24:52 stand1 kernel: [360766.871996] vizzini 1-4.3.1:1.0: no more free xr21v141x devices

Is it possible to extend the limitation at least to 64 devices?

shenki commented 10 years ago

You have 32 devices!?

I'm not sure where the limitation comes from. Searching the source, it could https://github.com/shenki/exar-uart-driver/blob/master/vizzini.h#L199 . You could try changing XR21V141X_TTY_MINORS from 32 to a larger number.

shenki commented 10 years ago

Did my suggestion resolve your issue?

tosa23 commented 9 years ago

Tested with 72 USBs and it's working properly. Thx for the suggestion. Used 104 for XR21V141X_TTY_MINORS. It should work up to 127 what is the USB controller limit, but please note:

Before embracing this idea as the console access cure-all, however, we should discuss the limitations. The first is the USB bus, which is limited to 127 devices per controller. This seems like a lot, but it is important to remember that hubs count as one device, and under Linux the root hub also counts as a device. So, consider a tree of USB hubs and USB-serial adapters. Let n be the number of ports per hub, k be the number of hubs in the tree and r be the number of USB-serial adapters. This gives us a total of n * k ports. To connect the k hubs in a tree we require a minimum of k – 1 interconnects, so the maximum number of USB-serial adapters is r = nk – (k – 1). Because there is a maximum of 126 devices (127 minus one for the root hub), in the best case we have k + r = 126. Solving for nk yields two equations, nk = 125 and r = 126 – k. When nk = 125 does not have an integer solution, it is best to round k up; otherwise, less than the maximum number of ports will be available. Consequently, with four-port hubs (n = 4) we have k = 32 and r = 94, for a maximum of 94 USB-serial adapters on a single controller. With seven-port hubs, k = 18 and r = 108.