Re: comedi-cvs buffer handling not SMP safe?

On Fri, Aug 30, 2002 at 12:41:48PM -0700, rhk_at_newimage.com wrote:
> With 0.7.64 and 0.7.65, I get correct behavior for analog input streaming, but for
> output streaming, it doesn't handle ending the stream cleanly (even with the patch I
> posted earlier). So I decided to try out the cvs version.
> 
> Both of the listed snapshots above generate correct output streaming behavior once
> the patch is applied. however, both of them fail miserably for analog input streaming.
> I am getting a message in the kernel log that says this: 
> 
> ni_mio_common: BUG: DMA overwrite of free area

This error message is a fancy way of saying "buffer overflow".  It
also means that there was possible corruption of data.  Previous
versions could corrupt data silently if there was a buffer overrun.
The buffer handling was changed to detect corruption, but the driver
has not been fixed to stop corrupting.

The new buffer code is more sensitive to buffer overflows not only
because of detecting the cases that previously caused corruption,
but also because the default buffer size is 4 pages -- and since
they're used (in this driver) in page-size chunks, for various
reasons, there's typically only one page free.  And sometimes, there's
none, which causes the buffer overflow.

The simple way to fix the problem is to make the buffer larger.  I
generally have little difficulty with 64 kB.



dave...

Received on 2002-08-30Z19:31:42