2017-08-28 11:22 GMT+03:00 Matwey V. Kornilov <matwey.kornilov@xxxxxxxxx>: > Hi all, > > I have an issue with the following patch: > c6dce2626606 ("USB: serial: ftdi_sio: fix extreme low-latency setting") > > I really need sub 16-ms latency for my peripheral and while I have no > problems with idea of setting ASYNC_LOW_LATENCY I would like point out > that it doesn't work as expected and probably need to be fixed. > > My user space code snipped is simple enough > > if (ioctl(fd, TIOCGSERIAL, &old_serial) == 0) { > struct serial_struct new_serial = old_serial; > new_serial.flags |= ASYNC_LOW_LATENCY; > > if (ioctl(fd, TIOCSSERIAL, &new_serial) < 0) { > return -1; > } > } > > My hardware is > > 0403:6001 Future Technology Devices International, Ltd FT232 > USB-Serial (UART) IC > > However, currently I see that > > 1) Application of ASYNC LOW_LATENCY is not taken immediately. That is > what I see from incoming data which arrives with considerable delays > after I TIOCSSERIAL. I suppose that latency timer is applied after the > end of currently running period. I.e I need to wait ~16ms and only > after then 1ms latency started. 16ms is quite considerable time for > nowadays user-space application. Well, from what I see from experiments with usbmon, the transition time is ~250ms. FTDI starts sending first BULK IN 250ms after TIOCSSERIAL (and then repeat every 1ms). I am sure that there is incoming data in FTDI's internal buffer all this time. Such delay is long enough. > 2) There is no generic reliable user-space way to wait until latency > settings are actually applied. I haven't find the way to determine > from user-space that it is ftdi_sio-driven tty-device and I need to > apply msleep-based quirks. > > So, my suggestion is that TIOCSSERIAL must block until latency > settings are actually applied which can be checked internally in the > driver. > > -- > With best regards, > Matwey V. Kornilov -- With best regards, Matwey V. Kornilov -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html