Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp600792yba; Fri, 3 May 2019 07:31:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzSstpg+jocqTwg4ZQW51jUd8b9Kr15WhNrj3wBbNv/cshagEY1cknJ8weSu2zuZkXoNuoy X-Received: by 2002:a17:902:141:: with SMTP id 59mr10678695plb.132.1556893877179; Fri, 03 May 2019 07:31:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556893877; cv=none; d=google.com; s=arc-20160816; b=Jo7mCD5FfADexI0XDxog6gn9Vnhi8jpMUkSzcxLqg5O4KKzscBxmx9bTHBJORJrtH0 CBM8e1Dk5Mi6C5BcyjKsK2mvKePMvtD7q9KejViOFamdgd2gaXtRZhX+zuMTFL8AgImm j7TwEoPrD41vAmrp3I/HW1kYB0rVs1kr64MsfRfy83DIHl2Qfss/9IxRpxC7giLbyV1w CfnvzAAjGvU7E822DlXPWggo+Rf3avOdJUCt8qCEm+de2Z4WNBQ1GVT+OwEKF9r5hZBS Z+XLKIIPKK16hkNUP9eStMI/ML/46u0bTiC2h/86Is06VB+FOtOmTUk3NMhIJOOuiFt9 /43Q== 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:date:subject:cc:to:from; bh=fKWgj+Uz8b6g+N3cfgJu196rA7L6P/zFr3K34HsfhBw=; b=05Y5kUznES4UUH6FvFZy0GKLRJqe6RlKigOlMl4mauhqiY+vATvdjmO7OavqENvneM YICB36KOSR3pDAm6De7htqfEU55VU3ByVsJgA8D64Hnb299CE1D2ppd7E3vDBYI22eXS fMyGJUJpvvNqpYyetGRkeieyyb2mIZjrT80b6p3AHVqVm8/ycLiucJur1BptEBA4x/xM boGoZdJMmLjuWIarQ5kSuZNNd7SMv6u0CCToqyZBbSsIrEkAdLO3pu/XemlbG8j/g5JF 68I0T10LZvOOrYuLIxSr/tWQKxk0GYUVl29x6bKBuLNu/Rk0vcY1ckV91OeluU/JHwsi nUqA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si2592128plc.424.2019.05.03.07.31.01; Fri, 03 May 2019 07:31:17 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728047AbfECN5m (ORCPT + 99 others); Fri, 3 May 2019 09:57:42 -0400 Received: from mxout013.mail.hostpoint.ch ([217.26.49.173]:64539 "EHLO mxout013.mail.hostpoint.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727740AbfECN5l (ORCPT ); Fri, 3 May 2019 09:57:41 -0400 Received: from [10.0.2.46] (helo=asmtp013.mail.hostpoint.ch) by mxout013.mail.hostpoint.ch with esmtp (Exim 4.91 (FreeBSD)) (envelope-from ) id 1hMYh0-0000Tx-H3; Fri, 03 May 2019 15:57:38 +0200 Received: from [46.140.72.82] (helo=philippe-pc.toradex.int) by asmtp013.mail.hostpoint.ch with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91 (FreeBSD)) (envelope-from ) id 1hMYh0-0003ks-8i; Fri, 03 May 2019 15:57:38 +0200 X-Authenticated-Sender-Id: dev@pschenker.ch From: Philippe Schenker To: linux-iio@vger.kernel.org, Jonathan Cameron , Stefan Agner , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler Cc: dev@pschenker.ch, 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: [PATCH 2/3] iio: stmpe-adc: Make wait_completion non interruptible Date: Fri, 3 May 2019 15:57:24 +0200 Message-Id: <20190503135725.9959-2-dev@pschenker.ch> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190503135725.9959-1-dev@pschenker.ch> References: <20190503135725.9959-1-dev@pschenker.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 problems. Making this wait_completion non interruptible solves the problem. Signed-off-by: Philippe Schenker --- drivers/iio/adc/stmpe-adc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c index 87141177fbda..baa41ffc0d76 100644 --- a/drivers/iio/adc/stmpe-adc.c +++ b/drivers/iio/adc/stmpe-adc.c @@ -78,8 +78,7 @@ static int stmpe_read_voltage(struct stmpe_adc *info, stmpe_reg_write(info->stmpe, STMPE_REG_ADC_CAPT, STMPE_ADC_CH(info->channel)); - 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); @@ -113,8 +112,7 @@ 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); -- 2.21.0