From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44A5AC04AB1 for ; Sat, 11 May 2019 10:16:02 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 11D7C217F9 for ; Sat, 11 May 2019 10:16:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IM/HZW55"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="VGf7UATU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 11D7C217F9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SsqBy6O+veK5GkXXUVdLRjnyF/zY6htr1EQgx+1Pp3M=; b=IM/HZW55wSsSAp Hw9GN/fkkPrNCkLlFid078pP7h9omDa01uBNpalA6goGk92ibwdil6SmwImCHdxNk4jUFJ8leSyyB Qv0UcBwAzfDw3wXHJCdvBDfHqCabpW130+b/jF+JvQo8GVwKiPFTfkq6+xMr6ZBBy67PYnTWZEmOt 1Fp0uP+m2BRYcqP3AtAGr8DLKdjaMLThMgjjFj6cte3VdD6kcxJw3n3/7rNe5DKY3kjB40FHAIXsV hyB3RGBmPGqxD0vWsAFfKpqHMGrqdag9DO65L63erE3s2l2AlQvRoAJ4Wz680Z2TduALF0vSrpKdV cqn8N4Np4A5Q8Y9FJWCw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hPP2s-0005ta-OH; Sat, 11 May 2019 10:15:58 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hPP2p-0005tH-V5 for linux-arm-kernel@lists.infradead.org; Sat, 11 May 2019 10:15:57 +0000 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (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 7916D208C0; Sat, 11 May 2019 10:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557569755; bh=GVjvzUgaZO5L08Vrif/Gj4NVQZ3V+nUBXORBy/xPtl0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=VGf7UATU+wbNMZj8Vn2IfAkAO93ECqaYnkNM0nI0ktDg20F/OWYS4d5STB4IPid8V bJwGWBld4bljFXZoG2vYlPdfr6JILEOLGCkmixATxgCYkevjNLgQrSVoWQqRtQa9mJ m7Z56V8aACpmRetJEsb5WCM9t/TRbG56GmxM5S4k= Date: Sat, 11 May 2019 11:15:48 +0100 From: Jonathan Cameron To: Philippe Schenker Subject: Re: [PATCH 4/5] iio: stmpe-adc: Use wait_for_completion_timeout Message-ID: <20190511111548.504948ae@archlinux> In-Reply-To: <20190507143615.28477-4-dev@pschenker.ch> References: <20190507143615.28477-1-dev@pschenker.ch> <20190507143615.28477-4-dev@pschenker.ch> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190511_031556_036695_4540E34F X-CRM114-Status: GOOD ( 17.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Coquelin , Lars-Peter Clausen , Max Krummenacher , Philippe Schenker , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Stefan Agner , Marcel Ziswiler , David Laight , Peter Meerwald-Stadler , Hartmut Knaack , Lee Jones , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Alexandre Torgue Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 7 May 2019 16:36:14 +0200 Philippe Schenker wrote: > From: Philippe Schenker > > Use wait_for_completion_timeout instead of > wait_for_completion_interuptible_timeout. > > The interruptible variant gets constantly interrupted if a user > program is compiled with the -pg option. > The killable variant was not used due to the fact that a second > program, reading on this device, that gets killed is then also killing > that wait. > > Signed-off-by: Philippe Schenker Hi Phillippe This one clashed a little bit with our earlier patch to remove the unnecessary assignment. I've applied it by hand but please check it. Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > > drivers/iio/adc/stmpe-adc.c | 18 ++++-------------- > 1 file changed, 4 insertions(+), 14 deletions(-) > > diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c > index 82b43e4522b6..cc752a47444c 100644 > --- a/drivers/iio/adc/stmpe-adc.c > +++ b/drivers/iio/adc/stmpe-adc.c > @@ -77,17 +77,11 @@ static int stmpe_read_voltage(struct stmpe_adc *info, > stmpe_reg_write(info->stmpe, STMPE_REG_ADC_CAPT, > STMPE_ADC_CH(info->channel)); > > - *val = info->value; > - > - ret = wait_for_completion_interruptible_timeout > - (&info->completion, STMPE_ADC_TIMEOUT); > + ret = wait_for_completion_timeout(&info->completion, STMPE_ADC_TIMEOUT); > > if (ret <= 0) { > mutex_unlock(&info->lock); > - if (ret == 0) > - return -ETIMEDOUT; > - else > - return ret; > + return -ETIMEDOUT; > } > > *val = info->value; > @@ -116,15 +110,11 @@ static int stmpe_read_temp(struct stmpe_adc *info, > stmpe_reg_write(info->stmpe, STMPE_REG_TEMP_CTRL, > STMPE_START_ONE_TEMP_CONV); > > - ret = wait_for_completion_interruptible_timeout > - (&info->completion, STMPE_ADC_TIMEOUT); > + ret = wait_for_completion_timeout(&info->completion, STMPE_ADC_TIMEOUT); > > if (ret <= 0) { > mutex_unlock(&info->lock); > - if (ret == 0) > - return -ETIMEDOUT; > - else > - return ret; > + return -ETIMEDOUT; > } > > /* _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel