From: Ian Abbott Date: Mon, 18 Jul 2011 10:30:08 +0000 (+0100) Subject: ni_pcidio: Mark buffer for writing when setting up DMA. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8736d0249869fe87604c38ca07bc7252d8bbccda;p=comedi.git ni_pcidio: Mark buffer for writing when setting up DMA. When setting up the DMA for 'read' streaming acquisition on the DIO subdevice, mark the whole buffer as writable before starting the DMA. This prevents a spurious detection of a DMA overwrite of good data during the first interrupt. Problem reported by Nico Nell. Fix suggested by Frank Mori Hess. Signed-off-by: Ian Abbott --- diff --git a/comedi/drivers/ni_pcidio.c b/comedi/drivers/ni_pcidio.c index 6de624d3..b39a2cf8 100644 --- a/comedi/drivers/ni_pcidio.c +++ b/comedi/drivers/ni_pcidio.c @@ -997,6 +997,9 @@ static int setup_mite_dma(comedi_device * dev, comedi_subdevice * s) devpriv->di_mite_chan->dir = COMEDI_INPUT; + /* write alloc the entire buffer */ + comedi_buf_write_alloc(s->async, s->async->prealloc_bufsz); + mite_prep_dma(devpriv->di_mite_chan, 32, 32); mite_dma_arm(devpriv->di_mite_chan);