From patchwork Fri May 3 13:57:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe Schenker X-Patchwork-Id: 10928813 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15B1014B6 for ; Fri, 3 May 2019 13:58:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03B78285D8 for ; Fri, 3 May 2019 13:58:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB995285E2; Fri, 3 May 2019 13:58:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A2622285D8 for ; Fri, 3 May 2019 13:58:06 +0000 (UTC) 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:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hX5iFRlj54+02exhCLw8m4FyPoO06n/9c2Y0zWpJCPg=; b=qLZgv31Tcg3gXT Hwu5SKNRa8wS1xjamuR40ya5g6qQkdWLvdnVArLzoyMuUoIIkIa3fED0DRNgpayygVGqnRPLd6Yap a0ZfIQA1sEdersbqtjSvphwOpHyjvIUgi6H8W+Fh20Xoyns1tCyG4qkiISAPvguk7bwJki5gAOS/m 9YarIEo/STS4+LgVKRIpL6JcUEtDuO+3ATsCa9hCvLFkL4vvd3Ous1wNqiaANyaeG7Sto9o62+Sbg LDHWhb9CoDAlK1mmZjzuZU2e3RiQsGKsJdV1x7OqTeM9Ta76K/2FPrd91QgU9FOKjIFTc0TEVwrfy RGSuWUElEOrFIxrKu5JQ==; 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 1hMYhN-0005wI-V3; Fri, 03 May 2019 13:58:01 +0000 Received: from mxout013.mail.hostpoint.ch ([2a00:d70:0:e::313]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hMYhC-0005nb-Hh for linux-arm-kernel@lists.infradead.org; Fri, 03 May 2019 13:57:52 +0000 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190503_065750_583537_259FD44E X-CRM114-Status: UNSURE ( 7.94 ) X-CRM114-Notice: Please train this message. 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 , Alexandre Torgue , linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, Philippe Schenker , Max Krummenacher , Lee Jones , dev@pschenker.ch, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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);