mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
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:
parent
f47732c0da
commit
9d452184fc
@ -93,12 +93,7 @@ static void iio_dmaengine_buffer_abort(struct iio_dma_buffer_queue *queue)
|
|||||||
struct dmaengine_buffer *dmaengine_buffer =
|
struct dmaengine_buffer *dmaengine_buffer =
|
||||||
iio_buffer_to_dmaengine_buffer(&queue->buffer);
|
iio_buffer_to_dmaengine_buffer(&queue->buffer);
|
||||||
|
|
||||||
dmaengine_terminate_all(dmaengine_buffer->chan);
|
dmaengine_terminate_sync(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().
|
|
||||||
*/
|
|
||||||
iio_dma_buffer_block_list_abort(queue, &dmaengine_buffer->active);
|
iio_dma_buffer_block_list_abort(queue, &dmaengine_buffer->active);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user