mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: "Hook, Gary" <Gary.Hook@amd.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dmaengine: dmatest: timeout value of -1 should specify infinite wait
Date: Tue, 4 Jun 2019 17:53:56 +0530	[thread overview]
Message-ID: <20190604122356.GY15118@vkoul-mobl> (raw)
In-Reply-To: <155933183362.4916.15727271006977576552.stgit@sosrh3.amd.com>

On 31-05-19, 19:43, Hook, Gary wrote:
> The dmatest module parameter 'timeout' is documented as accepting a
> -1 to mean "infinite timeout". Change the parameter to to signed
> integer, and check the value to call the appropriate wait_event()
> function.
> 
> Signed-off-by: Gary R Hook <gary.hook@amd.com>
> ---
>  drivers/dma/dmatest.c |   11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c
> index b96814a7dceb..28a237686578 100644
> --- a/drivers/dma/dmatest.c
> +++ b/drivers/dma/dmatest.c
> @@ -63,7 +63,7 @@ MODULE_PARM_DESC(pq_sources,
>  		"Number of p+q source buffers (default: 3)");
>  
>  static int timeout = 3000;
> -module_param(timeout, uint, S_IRUGO | S_IWUSR);
> +module_param(timeout, int, S_IRUGO | S_IWUSR);
>  MODULE_PARM_DESC(timeout, "Transfer Timeout in msec (default: 3000), "
>  		 "Pass -1 for infinite timeout");
>  
> @@ -795,8 +795,13 @@ static int dmatest_func(void *data)
>  		}
>  		dma_async_issue_pending(chan);
>  
> -		wait_event_freezable_timeout(thread->done_wait, done->done,
> -					     msecs_to_jiffies(params->timeout));
> +		/* A timeout value of -1 means infinite wait */
> +		if (timeout == -1)
> +			wait_event_freezable(thread->done_wait, done->done);

well i am not too happy that we have a infinite wait and no way to
cancel, maybe remove this case?

> +		else
> +			wait_event_freezable_timeout(thread->done_wait,
> +					done->done,
> +					msecs_to_jiffies(params->timeout));
>  
>  		status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
>  
> 

-- 
~Vinod

  reply	other threads:[~2019-06-04 12:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 19:43 Hook, Gary
2019-06-04 12:23 ` Vinod Koul [this message]
2019-06-04 16:47   ` Gary R Hook
2019-06-13 11:12     ` Vinod Koul

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=20190604122356.GY15118@vkoul-mobl \
    --to=vkoul@kernel.org \
    --cc=Gary.Hook@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®