From 8736d0249869fe87604c38ca07bc7252d8bbccda Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Mon, 18 Jul 2011 11:30:08 +0100 Subject: [PATCH] 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 --- comedi/drivers/ni_pcidio.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.26.2