Received: by 10.192.165.156 with SMTP id m28csp1099191imm; Wed, 11 Apr 2018 12:23:19 -0700 (PDT) X-Google-Smtp-Source: AIpwx49sV3PjQYTyaAZDx+v+i/2QySRPbsmxSSH1QbGnT5eDvsxuuAq4vLCaAQFGzPPwBHzc1VUo X-Received: by 10.99.120.138 with SMTP id t132mr4410013pgc.280.1523474599677; Wed, 11 Apr 2018 12:23:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523474599; cv=none; d=google.com; s=arc-20160816; b=Tim3Y1PqcQt+2NunmngFH+U7ZEDXHkIox3Jtyn+QD47zkmaIMVLnBI6RKKtmjgtfbk iiUWTHYRv0Jr5NVmTClzAF3oOsmfAa+YO9CxyxUln7o47us05Gh6nn69XGqCautkO2Es 0tpZ249SfsCvw/DyyCfRKdSRT8OuWffyvU/yi97nWdCKPPFAVreJ+p1FOli1Ym9aZBBm 8e4AZByuQmEhfoefFOOZUmE0pyMs5i2LRbjSaOx9REFXx1krcNE+DCLYfWbBpivc6uK1 X3yWRxN61wWZaUdIkxa5eAAQ/qZbaFqmhcbPc0Vnvv63cTl8o/VgqbloW245fSEyzZ42 akkQ== 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=IIGZj5kYD6h2M2KvdbDSIvKFKRmHrehdRfUUicMBA5o=; b=FgLIGESwEPjn4/9Zeno2K0q2HHg3kMektWaSNifFtwHJcvMft8dDmjGethaCSgFNng 4zbLbEHhLc6RxZGKiVVcqlUE30HUIuj2qiB637vCB7CGtUYN/J3/VhSg0XvBKeTubYOn 2JHygRppMK1RyvfT1vOzFoNRv6mj+4G5kQGRlbYjp5wENgAvkW2OGh8fWh21iwK0i1UA Foj829DlgZSp6yGYmMHaLw5P6n4OmFBmXJ0bBBh98GcuOQyJ1CW6FGdDA7Cp3QeAfx1Q 30u3NggrGdJqBYJ3CdgSsoCSpQwQjU3vOANdNC8snIeIGf3hcM1wWt0AAQGweBfcefpH d5Mg== 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 p13si1314129pfh.249.2018.04.11.12.22.43; Wed, 11 Apr 2018 12:23:19 -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 S934924AbeDKTE4 (ORCPT + 99 others); Wed, 11 Apr 2018 15:04:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40160 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934145AbeDKTEw (ORCPT ); Wed, 11 Apr 2018 15:04:52 -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 BD8E2CDD; Wed, 11 Apr 2018 19:04:50 +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.9 267/310] Input: goodix - disable IRQs while suspended Date: Wed, 11 Apr 2018 20:36:46 +0200 Message-Id: <20180411183634.142056912@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@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.9-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 @@ -778,8 +778,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); @@ -819,8 +821,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