On 11/11/14 00:57, H Hartley Sweeten wrote:
Currently the DMA buffers are switched before writing the current samples to the async buffer. This works but when the EOA event happens we end up with an outstanding DMA operation in progress that gets terminated by the (*cancel). Avoid the outstanding DMA operation by switching the DMA buffers after writing the samples. The driver will detect the EOA event and not retart the DMA.
I think the DMA buffer is switched early to try and avoid overruns in the hardware while the other buffer is being processed (by defragment_dma_buffer() and comedi_buf_write_samples()), so this patch is likely to reduce the maximum error-free throughput.
The combination of defragment_dma_buffer() and comedi_buf_write_samples() is a bit inefficient anyway, so perhaps we can drop this patch for now, and do a "no switch needed" test as part of another set of changes. (I can work on that if you want.)
-- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@xxxxxxxxx> )=- -=( Web: http://www.mev.co.uk/ )=- _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel