Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3079293yba; Sat, 11 May 2019 03:16:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUigeWeBaxyP6VP+1hIQTgu5zZJvcgnkWgr0oZaUo2P/4RTptV+aJS+GW+pllwja4Hi9sb X-Received: by 2002:aa7:91d5:: with SMTP id z21mr20836419pfa.222.1557569818529; Sat, 11 May 2019 03:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557569818; cv=none; d=google.com; s=arc-20160816; b=hLaFEVQY9yGWV6+u1+tUIXmxJr5u9Ph+XglDsNL/zVimqRvst2mqnB1h8Ibjxu5mb8 FXdsjwP7v0HdDxfxtMETsIttrv+J6e+vb8Sj8DCPH5RqGkrJNbsFAG/1h+7bdBJBH8rD iwib5Dor6+iGxEJH3Qt5iApN5Dqq8Wj7Gr7loshIGHVzsU++yGlWOriAEjbYUEwiaZdt T/Mm2cRTdE0yQ7t2bhJ/8ILRkT9scnfpUHZ6m3ZTj+irKkL2TN9s8CQ4mfjm4elfIH2U QrmdyAXjApLrUs42uO9qiEi317JtsD/CvBMMJ/fuP2lgz6Znv0fGadvTXKP/xT/Iuxeq oVtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=8kDfbdI8/adYVH7aR94fxSPZF/pE0xJozEv5R8LiVbo=; b=xjSgDivaeIq3c+YPbr2E82KhLXU2pEdxAcQRdUpl7h8hmYBIdy/eZSbSig07vCoISM nTMRbzT9Mtu+BetRJ0gw0GnUqM76ytOzi6gNeTQ2g2ODC2zGsFsJiSJ0QEGGRhlZqw82 URHqw8Sswu5LsxRR/D+DCS8nzTBqkNwZyl5V8Guz9fEbYSvUilMgNTEzEQaJDBKVdShn F+tR3hMYQZ/g2ZCxvPWJ9Hv1oEjQV1xZrl2y1Vx6jZ3pHarY29Fdq9vxGZosC1xRD50b 3oOFjjv3Css1XJZ6Maizf1PGXxi6azjidRtx4/oSxZ1USENeh6xFVf7by9sujVUTuCMA w/ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HAXe6Meo; 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 b193si5636276pfb.118.2019.05.11.03.16.41; Sat, 11 May 2019 03:16:58 -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=HAXe6Meo; 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 S1728559AbfEKKIk (ORCPT + 99 others); Sat, 11 May 2019 06:08:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:57648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728424AbfEKKIj (ORCPT ); Sat, 11 May 2019 06:08:39 -0400 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 DBB3E217D6; Sat, 11 May 2019 10:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1557569319; bh=SsM1ofarQZfVphiOzN1Muff7BbA5Z1fF8eufyrWWeQI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HAXe6MeobDUFP7WvrCs1xsgjUoGOeAmEG9RNlbuH+Ab7ZuTAzxqpPSMxZdkfT5wtQ aQsGa/YmucANFbQql6kff84p7mospL8kV8nxz1TrQyR+xpNWlZI8bFaiPCfeDi02Hb VoB5x2tTwt28/2zhixssWI4f11DWdWK3ai+hQEbw= Date: Sat, 11 May 2019 11:08:32 +0100 From: Jonathan Cameron To: Philippe Schenker Cc: linux-iio@vger.kernel.org, Stefan Agner , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Marcel Ziswiler , David Laight , Philippe Schenker , Max Krummenacher , Alexandre Torgue , linux-kernel@vger.kernel.org, Lee Jones , Maxime Coquelin , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 2/5] iio: stmpe-adc: Reinit completion struct on begin conversion Message-ID: <20190511110832.24f58e4a@archlinux> In-Reply-To: <20190507143615.28477-2-dev@pschenker.ch> References: <20190507143615.28477-1-dev@pschenker.ch> <20190507143615.28477-2-dev@pschenker.ch> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 7 May 2019 16:36:12 +0200 Philippe Schenker wrote: > From: Philippe Schenker > > In some cases, the wait_completion got interrupted. This caused the > error-handling to mutex_unlock the function. The before turned on > interrupt then got called anyway. In the ISR then completion() was > called causing wrong adc-values returned in a following adc-readout. > > Reinitialise completion struct to make sure the counter is zero > when beginning a new adc-conversion. > > Signed-off-by: Philippe Schenker Hi Philippe, To me this looks like a fix that we should consider applying to stable. However, as it is in the middle of this series I'm not going to take it via the fast route (during rc's). If people want to backport it they will have to wait until after the next merge window. If anyone has an urgent need, then shout in the next week and I'll pull this version out and we can restructure the set. 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 | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c > index 9ec338ba3440..b3872eb37293 100644 > --- a/drivers/iio/adc/stmpe-adc.c > +++ b/drivers/iio/adc/stmpe-adc.c > @@ -65,6 +65,8 @@ static int stmpe_read_voltage(struct stmpe_adc *info, > > mutex_lock(&info->lock); > > + reinit_completion(&info->completion); > + > info->channel = (u8)chan->channel; > > if (info->channel > STMPE_ADC_LAST_NR) { > @@ -105,6 +107,8 @@ static int stmpe_read_temp(struct stmpe_adc *info, > > mutex_lock(&info->lock); > > + reinit_completion(&info->completion); > + > info->channel = (u8)chan->channel; > > if (info->channel != STMPE_TEMP_CHANNEL) {