On 19/09/2005 11:52, Anders Blomdell wrote:
Hi,

I have an application the relies on setting the serial port into low latency mode, but this doesn't work well with ftdi_sio.c, because:

1. setting low latency (priv->flags & ASYNC_LOW_LATENCY) requires CAP_SYS_ADMIN

That has always been the case with Linux serial drivers.

2. setting low latency doesn't affect the latency timer (FTDI_SIO_SET_LATENCY_TIMER_REQUEST)

(Note for regulars: this is a hardware timer that tells the FTDI chip how often to report received data.)

I guess it could be argued that there should be some link between the two. Then again, it could also be argued that there should be some link with c_cc[VTIME] in the termios structure in non-canonical mode (though that has too large a range and too low a resolution to be of much use here).

The submitted patch makes:

  1. The driver start in normal latency mode (previously low latency)

I'd rather it not do that. Low latency mode has some advantages that would be lost by default with this patch.

  2. Let any user change latency (i.e. no CAP_SYS_ADMIN required)

That goes against the grain of existing Linux serial drivers.

3. Setting low latency sets the latency timer to 1 ms, normal latency sets the
     latency timer to 16 ms (chip default).

There is some merit in that, but keeping the port initialixed to low latency mode as I recommend would result in an increased overhead as data may be received in shorter chunks. This would reduce the maximum throughput. So it boils down to whether the port should be initialized for lowest latency or maximum throughput by default.

Note that there is an "out of band" solution to tweaking the FTDI chip's latency timer via a sysfs parameter.

With the patch applied, low latency mode gives a delay of about 3-4 ms in contrast
to the 16 ms normally encountered.

Just wondering: as you still get a latency of 3-4 ms, have you tried setting the FTDI chip's latency timer to a similar number to see how much difference it makes?

Regards,
Ian Abbott.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <[EMAIL PROTECTED]>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to