Received: by 10.213.65.68 with SMTP id h4csp1876411imn; Mon, 19 Mar 2018 16:03:51 -0700 (PDT) X-Google-Smtp-Source: AG47ELvIKz5nmk1lzOCG8LLLMrq1OAWwm+q+Xj3lkyQthHTFF2XjqGabOlHCveM5rQ1YtOeDP4Tp X-Received: by 10.98.141.65 with SMTP id z62mr11755487pfd.129.1521500631848; Mon, 19 Mar 2018 16:03:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521500631; cv=none; d=google.com; s=arc-20160816; b=VZgm69WuaeABCfI00UKIONaE25gfk6PYuRgihUWC/aem32CO1q87Gc8x/ggHiWfBNJ sYv3f47QuAsLYWUAv615dTb6+pdWFC1gHgj9Oux7FwxABlbg4a5wP00hBU5KCAK82Z6/ cKhECGvLwuJdL5qJBRrc0P4xFie0yM1p2BBORoJ4/FvZds+VlbNw3rHGZU+d91AlfrUC aVRYPdxmUkKE61C/E2SOfg0g5aq7mUbQAuRrpS8BZrrrD8vSqTC4PR5A7sJwT5MGHeew OeIIBFZv1q0Hgnobyyk1ZmQHTWYUETx2yttWl12HQMy40vKx+QVDtRkPUl/coe4inNAb Wz+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=YsZdcu4v74aJzFKX7JbWxmWEgboy9P4e1Z++Fh/z3WA=; b=WgPHeEcTbZatvIRlaTfz2cmXndU0EfQheOfn2d2W0Xk7TKmPnhWQ49SFWvYlQc7v74 TIlIK84X266e40ctofgn10IKFF+Nm7Y95P4Xa163Q50a/cGW2YHjEPPIib7fOecK1cnX 6Jj4dZaQPKLcI65PnM0e6/n0FKer3C/ebAtSHCLC5uzy/1oCGz2/jEsKODxHpHNJ/rGY t9+r86wkuR4l1ZEKP7BRNPxjK7EseZOjFCDsq3DObSEFNRqpllhrK9ce6NdrB14qTeRR BktbWH5KSDFlnIbkYu/Qcst8SGWTP1UM7jR8clzkhmNbbw2/F2NoJ6AczhWnk4D07KEL 3g5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Lm4QA3eA; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n34-v6si260963pld.603.2018.03.19.16.03.37; Mon, 19 Mar 2018 16:03:51 -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=@microsoft.com header.s=selector1 header.b=Lm4QA3eA; 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=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933979AbeCSPyV (ORCPT + 99 others); Mon, 19 Mar 2018 11:54:21 -0400 Received: from mail-bl2nam02on0111.outbound.protection.outlook.com ([104.47.38.111]:9280 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934022AbeCSPuK (ORCPT ); Mon, 19 Mar 2018 11:50:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=YsZdcu4v74aJzFKX7JbWxmWEgboy9P4e1Z++Fh/z3WA=; b=Lm4QA3eA21eHdxXFUmMkwTdX3OfxXHg2G0hhotC7v6YL8L2+24ll+0pjky7+D4sGTpQajAh5ZKoDX2rnqXVFz67REpCvNHNN6Yh9EA0URpIy8Jgd0SLj0iZPAH1XL72XZCFtdQu5B5qaerG3WNZDANTZon+4BuzCEpEEFftWAYk= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1109.namprd21.prod.outlook.com (52.132.130.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.631.0; Mon, 19 Mar 2018 15:49:59 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::3d9b:79e7:94eb:5d62%5]) with mapi id 15.20.0631.004; Mon, 19 Mar 2018 15:49:59 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Hans de Goede , Dmitry Torokhov , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 113/124] Input: goodix - disable IRQs while suspended Thread-Topic: [PATCH AUTOSEL for 4.15 113/124] Input: goodix - disable IRQs while suspended Thread-Index: AQHTv5nQgGQB2+OzkkW33FTHeo3xWA== Date: Mon, 19 Mar 2018 15:49:07 +0000 Message-ID: <20180319154645.11350-113-alexander.levin@microsoft.com> References: <20180319154645.11350-1-alexander.levin@microsoft.com> In-Reply-To: <20180319154645.11350-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1109;7:I3Jsgck6/btDG+YzpqqcIkJefaDGAV/5Bbp4AKPoHPib5CHtQwB+FNqjZ47JFAjnk/3izv/rxapJJ6sKI1tunxNavUsF/zcOkp2ENHQSKo8FjgbjvUUl5uNo/qtPrk0LBQeg31/DE3aJ4oPkeaFX8+lYGsIdR0VR/xWhgrF/OfmMKWnvfxp6Z5zPXUoqkBPbJmZ5lCwYG03AWGo6MWN4s7PBjO4+WtoP9yxuVhW/i/jFB36htfsWUQP3DbNPvKUL;20:FOjkbC0fjV73vFvIYak27ooZnekYE7eeLcZ+X1PgsCgjY4GelRW43Tt2xZpxWZfjGf1JtKBqzij1faPikD/ZNl8+HobtWAfwIT6QqLXbijhdhAbEOk2Pjh9s6UnrmLyLw+u9jdHMouQvSztmmDdiO5h7KFwaEzFbjdCbs/OVDcg= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 58aac93c-9df1-4722-4a86-08d58db11218 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1109; x-ms-traffictypediagnostic: DM5PR2101MB1109: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(166708455590820)(85827821059158); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501300)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:DM5PR2101MB1109;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1109; x-forefront-prvs: 06167FAD59 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(396003)(39860400002)(39380400002)(376002)(346002)(199004)(189003)(81166006)(10290500003)(107886003)(81156014)(106356001)(6506007)(8676002)(3846002)(36756003)(8936002)(97736004)(6116002)(1076002)(102836004)(68736007)(6666003)(3280700002)(2950100002)(3660700001)(478600001)(72206003)(59450400001)(2906002)(15650500001)(14454004)(966005)(76176011)(66066001)(6512007)(39060400002)(6306002)(5250100002)(10090500001)(2501003)(53936002)(6486002)(6436002)(26005)(316002)(22452003)(305945005)(7736002)(4326008)(25786009)(86362001)(575784001)(86612001)(5660300001)(2900100001)(99286004)(54906003)(186003)(105586002)(110136005)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1109;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: xAskwIBWM6ratDislV7KfPOAQ+KZWU0kcwpddgrWQeWgXFnvD/vt6+BmEhOtuTLQN+A59GFklm+U3kUiEnxFoBp1sgTPI5PuMpCL9OfWDQQHhx2+ejV1iWrqUTu5qCmLekgt1IUZtpCMsWnoypgKai0Dj2X9YBg18ZVtomwWtwaaMWE7dOEBcThpFIBl1/1MNjt37wKXZ1WsDH3OwenKX++sxmmQlBLMXjsCaBaa5M/NQhTkw19PrqB5NwOidA1+4Pez/wzhkcdLAvrnJr9B61UNslzWxFMBOgDnlPH1GO/GpXv8g460AXk9TfsYqJteesLwVLi/eHIJQzdEvLBXMw== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58aac93c-9df1-4722-4a86-08d58db11218 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Mar 2018 15:49:07.3498 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1109 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/input/touchscreen/goodix.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen= /goodix.c index 69d0b8cbc71f..ecec8eb17f28 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -878,8 +878,10 @@ static int __maybe_unused goodix_suspend(struct device= *dev) int error; =20 /* 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; + } =20 wait_for_completion(&ts->firmware_loading_complete); =20 @@ -919,8 +921,10 @@ static int __maybe_unused goodix_resume(struct device = *dev) struct goodix_ts_data *ts =3D i2c_get_clientdata(client); int error; =20 - if (!ts->gpiod_int || !ts->gpiod_rst) + if (!ts->gpiod_int || !ts->gpiod_rst) { + enable_irq(client->irq); return 0; + } =20 /* * Exit sleep mode by outputting HIGH level to INT pin --=20 2.14.1