Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5352452ybi; Tue, 4 Jun 2019 05:30:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzU6lpQr1v3vLxdxTP25WdA9IVRw0b1vnCaP7cWnX278fLrs72OnincTCDuwkuLGKPmpzZu X-Received: by 2002:a63:6157:: with SMTP id v84mr20881456pgb.36.1559651415497; Tue, 04 Jun 2019 05:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559651415; cv=none; d=google.com; s=arc-20160816; b=scRykNtFCU6RSRNSW9Yu4azAFpWdTsz98RVVbP+Gxcf+cF7xodBu3fsxPBybMt1yqy gv3HDpwGUY5fjT13DzZ9kJ8hhyMJnsJCpAxKmnwbcaQzpliGpmvV7ZNaBJwH7tumkvKm UOU6cTnUHdNTxXjXZuBi6dtWvt/n5pLEm1iaKVARznrFdOkPwYucwyajbJwXUaKySFp0 U/r06uWSXDX1i/V1OKCpAMCIGXkIsgphSvCwzmkyA87sfMLgRyqqVFIMcrPo6MtufqUn PiLoeiUknBZsF/JTesXuYok/V8H/dgK5mGMvakC6Zh7E/+81KJ/nah3yj4Gaz9HWKTIS vKBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KD61wJ2WOwJ7s1d6iknPqk378YmnIPrSMO5djwRn4J0=; b=PH7pwbgJCQcUZWR+aOhqTsGYZlQkHPFrg3qWl/OYUYSLU6MRy60zV6Eu8omsxWoqAK HmmvgMOnIg1QKHsMfwNRDDbI/QBdMJJEBZO76Z8KcRLSzt+nK1V40Dj/2qGMFG9mbaoQ 5BnhS2tx1s3cuUN99fEMcbMnxWJ+69hRysIMcSp3I+ZDChRCy0S6avLhEKLJgh+lpURL ghvfHfO89xmn4yJrjOZtfRbt7d0JJJAOoQttbsLdIwaXeCWWaPuMSvsfPA06hLuMygjY 8ML+IRezXe6GwrwmM2DZz8HJjUy66LoQ0GN7oR8jY27dTApYQDrO09a7tBfb/xBdLmQE oB3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O9748DDE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si22698639pgy.582.2019.06.04.05.29.57; Tue, 04 Jun 2019 05:30:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=O9748DDE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727792AbfFDM1F (ORCPT + 99 others); Tue, 4 Jun 2019 08:27:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:58300 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbfFDM1F (ORCPT ); Tue, 4 Jun 2019 08:27:05 -0400 Received: from localhost (unknown [117.99.94.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 250F420665; Tue, 4 Jun 2019 12:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559651224; bh=iaMFRIk0Y0W/DnigZZek04DJjtoqETqrBE8Yb9t2yls=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O9748DDEH8P8t3FQitaeEc2OO+rCZXtahQC0U5bCHPWevGAQWCTFjH5frdl6hyWsv aw+dOC7KcxPplabgvltFxlX6ku2NvJjo6flv4/x1gPM4wB4JhnSzSIave4FmcLqrmi 0RNkc7stgEXdCq1GCLR+2atcJgVlG7Ewr963Ofy4= Date: Tue, 4 Jun 2019 17:53:56 +0530 From: Vinod Koul To: "Hook, Gary" Cc: "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] dmaengine: dmatest: timeout value of -1 should specify infinite wait Message-ID: <20190604122356.GY15118@vkoul-mobl> References: <155933183362.4916.15727271006977576552.stgit@sosrh3.amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <155933183362.4916.15727271006977576552.stgit@sosrh3.amd.com> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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