iio: buffer-dmaengine: Use dmaengine_terminate_sync()

The DMAengine framework gained support for synchronized transfer
termination. Use the new dmaengine_terminate_sync() function instead of
dmaengine_terminate_all(), this avoids a potential race condition when
disabling the buffer.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Lars-Peter Clausen 2016-02-08 18:51:58 +01:00 committed by Jonathan Cameron
parent f47732c0da
commit 9d452184fc

View File

@ -93,12 +93,7 @@ static void iio_dmaengine_buffer_abort(struct iio_dma_buffer_queue *queue)
struct dmaengine_buffer *dmaengine_buffer =
iio_buffer_to_dmaengine_buffer(&queue->buffer);
dmaengine_terminate_all(dmaengine_buffer->chan);
/* FIXME: There is a slight chance of a race condition here.
* dmaengine_terminate_all() does not guarantee that all transfer
* callbacks have finished running. Need to introduce a
* dmaengine_terminate_all_sync().
*/
dmaengine_terminate_sync(dmaengine_buffer->chan);
iio_dma_buffer_block_list_abort(queue, &dmaengine_buffer->active);
}