ftdi_sio: timing issue while setting ASYNC_LOW_LATENCY from user space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
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
--
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



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux