linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: buffer-dmaengine: Use dmaengine_terminate_sync()
Date: Tue, 9 Feb 2016 21:07:21 +0000	[thread overview]
Message-ID: <56BA5509.7030404@kernel.org> (raw)
In-Reply-To: <1454953918-1004-1-git-send-email-lars@metafoo.de>

On 08/02/16 17:51, Lars-Peter Clausen wrote:
> 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>
Applied - thanks,

Jonathan
> ---
>  drivers/iio/buffer/industrialio-buffer-dmaengine.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/iio/buffer/industrialio-buffer-dmaengine.c b/drivers/iio/buffer/industrialio-buffer-dmaengine.c
> index ebdb838..9fabed4 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);
>  }
>  
> 


      reply	other threads:[~2016-02-09 21:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 17:51 [PATCH] iio: buffer-dmaengine: Use dmaengine_terminate_sync() Lars-Peter Clausen
2016-02-09 21:07 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56BA5509.7030404@kernel.org \
    --to=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).