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

Re: Serial Latency Issues, Baud Rate Affects Buffering

On Monday 12 January 2004 01:51, Mikael Starvik wrote:
> On the website we have a patch compared to 2.4.22. The patch contains
> e.g. a newer serial port driver. In 2.4.25 the official sources will
> contain the serial driver patches. Takes a while to get our stuff
> into the official trees.

As Johan mentioned previously, the 2.4.22 patch is found in the devboard_82 
tarball.  It might be useful to place the patch in the download/linux 
directory.  The 2.4.10 and the 2.4.19 patches are there as well as the 2.4.22 
official source, I would expect to find the 2.4.22 patch there as well.

> PS. As Johan already mentioned you can never trust that you will get
> 7 characters at each iteration. User space has no guarantees what
> so ever. DS.

I agree that there are no guarantees in user space.  I do not expect real-time 
behavior from the stock linux kernel (perhaps in 2.8 :-)

I am looking for the BEST way to "reduce" the latency between when the serial 
port reads the data and when it is available to user space.  With the default 
options, it takes over 1/2 second for data read on the serial port to reach 
userspace.  This is unacceptable for our application.

None of the previously mentioned options in this thread: 


All of these options expect the serial port to stop transmitting data for a 
period of time before flushing the DMA buffer.  Our stream transmits data 
almost continuously, thus the DMA buffer is never flushed UNTIL it is full at 
256 bytes, which at 4800 baud, is over 1/2 a second.  Note, I still need to 
try the code modification mentioned in a previous message.

The new serial driver provides an option for disabling DMA.  What are the 
repercussions of disabling DMA?  Will this help reduce the latency in the 

Thank you for all of your help, it is greatly appreciated,


Eric Sorton
Senior Member Research Staff
Institute for Scientific Research (ISR), Inc.
119 Roush Circle
Industrial Park Road
Fairmont, WV  26554
Email: esorton@xxxxxxx.org
URL: http://www.isrparc.org
Voice: 304-368-9300 x219
FAX: 304-534-4106