- From: <rhk_at_newimage.com>
- Date: Wed, 09 Oct 2002 17:17:58 -0700
Message-Id: <20021010001757.B9D52E021_at_newimage.com>
Date: Wed, 9 Oct 2002 20:17:57 -0400 (EDT)
From: rhk_at_newimage.com (Apache User)
This one is also related to long term analog input streaming,
for the NI MIO boards. The check for DMA overwriting the free
area doesn't take into account wraparound.
My web-based email app wrapped a few lines in the patch,
Hopefully it is not too hard to look at.
-Ray
--SNIP--
diff -ru2 ni_mio_common.c.orig ni_mio_common.c
--- ni_mio_common.c.orig 2002-09-05 10:08:19.000000000 -0400
+++ ni_mio_common.c 2002-10-09 17:52:23.000000000 -0400
_at__at_ -350,5 +364,5 _at__at_
comedi_subdevice *s = dev->subdevices + 0;
comedi_async *async = s->async;
- int nbytes;
+ unsigned int nbytes;
int ret;
_at__at_ -356,6 +370,7 _at__at_
nbytes = mite_bytes_transferred(mite, 0);
- if(nbytes >= async->buf_free_count){
- printk("ni_mio_common: BUG: DMA overwrite of free area\n");
+ if((nbytes - async->buf_write_count) > (async->buf_free_count -
async->buf_write_count)){
+ printk("ni_mio_common: BUG: DMA overwrite of free area (nbytes=%u)\n", nbytes);
+ show_async(async);
ni_ai_reset(dev,s);
async->events |= COMEDI_CB_OVERFLOW;
--SNIP--
Received on 2002-10-09Z23:17:58