Skip to content

Commit

Permalink
staging: comedi: ni_pcidio: Mark buffer for writing when setting up DMA.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Feb 9, 2012
1 parent 9e77e6b commit 41add2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/staging/comedi/drivers/ni_pcidio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 41add2e

Please sign in to comment.