Received: by 10.192.165.148 with SMTP id m20csp527831imm; Wed, 25 Apr 2018 03:43:04 -0700 (PDT) X-Google-Smtp-Source: AIpwx49gKPx2TIxUaWgWls54ic8QLZlod5lVMjCPe2Cul5VCznqP0C97UZ739w1E8zZuNAx3r8Q/ X-Received: by 10.99.126.78 with SMTP id o14mr13850942pgn.18.1524652984590; Wed, 25 Apr 2018 03:43:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524652984; cv=none; d=google.com; s=arc-20160816; b=WylGd7xr2LZqpKKYcl6JkEJipnp/HjaY2/dZngUSuMC5DufslkxOMjZ5N8/THgo5oH xl1rBxBZXCa/49ea8Ntb0p10QAo1X9BzyvIqmDDs/2RbGWLZtiL9o6ttSV5w+gNF989E jAf38AKy5Evo7SmYxBKk/CuHDz1Coi01WvPswm8FbpoTr9PIxCX2TEz9/R3jhuA6vdzy PqMiThE9KBQEncw/kNpuTE6CTZ5pFB6nVqHMuVU9QQu5Lp9/OWaiGjb6wyH/0FgOv9gg zx9IRuDXuOuI+BKxuSD1r4JfFkxcBnlOvPUAWAwMCKfmezwpqVfMjDDpvXqJxAwQZi0Q Rucg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=k1PpsV/ci/nRJ8yi0Rytqb6A6mLvSB2BrZOrywY2L90=; b=PuoRaikd8zLPxdGrQ3NtyqQ99MnZ7hn5EOpUC1NnAvy6cPTgVj1IukFfy0GeQ+hiu9 q/BnTmovG7L4x9jHuQeLjZ4Z9KIacIuwVVQjnwnJpaTgEWQ867PVjZzihYmv4XhShwYP M5FH193k5bz59lpLLJJ/GhWVvymEFnSrw7dwq+QmfktfW2D0yrkaUbL5cb8sfNSsLEo/ /uWyKVo+ewv70vu1YclynLFBXBJpbDmu2K5gCmiVK8db/mJs+5LzB6sRwAs4ZjjUveWb +kOohyz3HJa5Yy3EVM9vfPvj+n2ugF0wSLGMV27LrfHKRfMJWwuSbD4bU7nM38U/YIVM Ju2g== 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 bc6-v6si16667617plb.302.2018.04.25.03.42.50; Wed, 25 Apr 2018 03:43:04 -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 S1754015AbeDYKlk (ORCPT + 99 others); Wed, 25 Apr 2018 06:41:40 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52422 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbeDYKlg (ORCPT ); Wed, 25 Apr 2018 06:41:36 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id EE58336; Wed, 25 Apr 2018 10:41:35 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andi Shyti , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.14 073/183] Input: stmfts - set IRQ_NOAUTOEN to the irq flag Date: Wed, 25 Apr 2018 12:34:53 +0200 Message-Id: <20180425103245.454700325@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andi Shyti [ Upstream commit cba04cdf437d745fac85220d1d692a9ae23d7004 ] The interrupt is requested before the device is powered on and it's value in some cases cannot be reliable. It happens on some devices that an interrupt is generated as soon as requested before having the chance to disable the irq. Set the irq flag as IRQ_NOAUTOEN before requesting it. This patch mutes the error: stmfts 2-0049: failed to read events: -11 received sometimes during boot time. Signed-off-by: Andi Shyti Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/input/touchscreen/stmfts.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/drivers/input/touchscreen/stmfts.c +++ b/drivers/input/touchscreen/stmfts.c @@ -687,6 +687,14 @@ static int stmfts_probe(struct i2c_clien input_set_drvdata(sdata->input, sdata); + /* + * stmfts_power_on expects interrupt to be disabled, but + * at this point the device is still off and I do not trust + * the status of the irq line that can generate some spurious + * interrupts. To be on the safe side it's better to not enable + * the interrupts during their request. + */ + irq_set_status_flags(client->irq, IRQ_NOAUTOEN); err = devm_request_threaded_irq(&client->dev, client->irq, NULL, stmfts_irq_handler, IRQF_ONESHOT, @@ -694,9 +702,6 @@ static int stmfts_probe(struct i2c_clien if (err) return err; - /* stmfts_power_on expects interrupt to be disabled */ - disable_irq(client->irq); - dev_dbg(&client->dev, "initializing ST-Microelectronics FTS...\n"); err = stmfts_power_on(sdata);