comedi-cvs buffer handling not SMP safe?

Message-Id: <20020830194138.13F0ADFD6_at_newimage.com>
Date: Fri, 30 Aug 2002 15:41:38 -0400 (EDT)
From: rhk_at_newimage.com (Apache User)

I am using the pci-mio-16e-1 driver, and am having some difficulties with analog
input and output streaming. Hopefully the results I'm reporting will help to iron out
the driver problems.

I have tried my tests with various comedi versions, including:

0.7.64
0.7.65
cvs (2002-07-29)
cvs (2002-08-29)

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
I tried tracking down the problem that causes this message, with some interesting
results. First, the condition that causes the message occurs almost all the time. I
suspect that it's not checking the right variable, since it is comparing nbytes to
buf_free_count, and it looks like buf_free_count is not tracking what I expect it to
track. It's not really clear what the buffer handling code is supposed to be doing.

Also, the behavior is different when I remove the second processor from the machine. 
I took a look at the comedi_async buffer handling, and it doesn't look like this may
not be SMP safe unless there is some locking mechanism that I missed.

In the meantime, I'm going to patch 0.7.65 to fix the analog output problem, since it
seems to be the easier of the two problems to solve, and I have a (rediculous manager
determined) deadline to meet.

-Ray

Received on 2002-08-30Z18:41:52