summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2012-01-09 15:47:30 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-09 18:00:36 (GMT)
commit41add2e84bff0c887949698e01dab28105f11a6b (patch)
treef5488d770c5178b6f502614b82bac19fb0025765 /drivers/staging/comedi
parent9e77e6b62e699fe23a4648ac438115c5fc952e42 (diff)
downloadlinux-fsl-qoriq-41add2e84bff0c887949698e01dab28105f11a6b.tar.xz
staging: comedi: 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 Nicholas Nell. Fix suggested by Frank Mori Hess. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi')
-rw-r--r--drivers/staging/comedi/drivers/ni_pcidio.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c
index 045a4c0..c9e5f2b 100644
--- a/drivers/staging/comedi/drivers/ni_pcidio.c
+++ b/drivers/staging/comedi/drivers/ni_pcidio.c
@@ -1012,6 +1012,9 @@ static int setup_mite_dma(struct comedi_device *dev, struct 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);