summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2016-02-08 18:51:58 +0100
committerJonathan Cameron <jic23@kernel.org>2016-02-09 21:05:17 +0000
commit9d452184fc9d9c3a0e6df5910857c6017865e3c0 (patch)
treeba17ed3bcd31ff7f7248b906c246ed5ccff5da28 /drivers
parentf47732c0daf5d1607ba0775edad3460d18ee1f83 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/iio/buffer/industrialio-buffer-dmaengine.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
index ebdb838d3a1c..9fabed47053d 100644
--- a/drivers/iio/buffer/industrialio-buffer-dmaengine.c
+++ b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
@@ -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);
}