Received: by 10.192.165.156 with SMTP id m28csp61681imm; Tue, 10 Apr 2018 16:25:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx49uNZGHRXL06+D8UwJJFRYDLdXfd9Vtb5qNd7aOBlne+AgtmHfH5Zvwk4q8x0vt19dz7/6s X-Received: by 10.98.157.199 with SMTP id a68mr1924915pfk.237.1523402722233; Tue, 10 Apr 2018 16:25:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523402722; cv=none; d=google.com; s=arc-20160816; b=jLogHh39dzu7PFISEZF68MrVkhA4BFHRUT+QOfaN3kqEc2Y5LXyOzr6wqZCrmntCb5 5zdsMTFNjYARA6vf3eraQD5vBoIyi9dljYVf8hKb/VRvv9NqQuD7W0WK1/MIbDKC0rzU qDmr6lvR27oQjyLttzSpuXj/RIVrR4qxtvpKTvH0k6XqZxQhZRkAWkPkBoogJCaFlCbS 0cUETGkuFItTYiwY28PjTqg2HgooZklHl2dMJ0EKYOPONVBfAp/fpDRaz0AhB2j3hS7u 1mhBa1d2P33isE6Oh6H2d7LPrN4ulzuewV8K7e0kIe/k+NDdX+zgwI2wB86/6fCN9w2C Ehlg== 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=zNUxtYfkD3Y30SPyYCdxKKWYJdMDIWZa7cL+7FXgdbc=; b=ALhSTin27BQ8qMnxzrh1weR36DDYjgJaDrcA8xCxDTQzdJWfYN+Mu6rquuUSzMyX5p kS9DiKu9ZMRq9wRXlCW7i1WyYxdGplgcJx0ZiHSt3MxlX+bC41RAGsdlSd2fczjKNECC gv9RGDZcEaNZCZcpnK0CsJAm48LRWUj895hne/S9Gi2ErVKAr4J57WiWJttcvmPLUdHQ hJ7LUQB6Wfpjmp5iPK8AKH/UjuK+V2MGczaRu90qVLYEgYCj7iSitZzR5e6DTk8nRRJT TxWj5nUd4gBbOuuoShkEiaiGae/S6hzcdRxgkgkOrxBZBBDyjPcqsW4LAVNkGAMvjn+f ZoHA== 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 n6-v6si3223333plp.194.2018.04.10.16.24.45; Tue, 10 Apr 2018 16:25:22 -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 S1754992AbeDJXT1 (ORCPT + 99 others); Tue, 10 Apr 2018 19:19:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40278 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754740AbeDJWbJ (ORCPT ); Tue, 10 Apr 2018 18:31:09 -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 2BBEDDE0; Tue, 10 Apr 2018 22:31:09 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Bastien Nocera , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.15 101/168] Input: goodix - disable IRQs while suspended Date: Wed, 11 Apr 2018 00:24:03 +0200 Message-Id: <20180410212804.549445970@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@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.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede [ Upstream commit faec44b6838312484d63e82286087cf2d5ebb891 ] We should not try to do any i2c transfers before the controller is resumed (which happens before our resume method gets called). So we need to disable our IRQ while suspended to enforce this. The code paths for devices with GPIOs for the int and reset pins already disable the IRQ the through goodix_free_irq(). This commit also disables the IRQ while suspended for devices without GPIOs for the int and reset pins. This fixes the i2c bus sometimes getting stuck after a suspend/resume causing the touchscreen to sometimes not work after a suspend/resume. This has been tested on a GPD pocked device. BugLink: https://github.com/nexus511/gpd-ubuntu-packages/issues/10 BugLink: https://www.reddit.com/r/GPDPocket/comments/7niut2/fix_for_broken_touch_after_resume_all_linux/ Tested-by: Hans de Goede Signed-off-by: Hans de Goede Reviewed-by: Bastien Nocera Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/input/touchscreen/goodix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -878,8 +878,10 @@ static int __maybe_unused goodix_suspend int error; /* We need gpio pins to suspend/resume */ - if (!ts->gpiod_int || !ts->gpiod_rst) + if (!ts->gpiod_int || !ts->gpiod_rst) { + disable_irq(client->irq); return 0; + } wait_for_completion(&ts->firmware_loading_complete); @@ -919,8 +921,10 @@ static int __maybe_unused goodix_resume( struct goodix_ts_data *ts = i2c_get_clientdata(client); int error; - if (!ts->gpiod_int || !ts->gpiod_rst) + if (!ts->gpiod_int || !ts->gpiod_rst) { + enable_irq(client->irq); return 0; + } /* * Exit sleep mode by outputting HIGH level to INT pin