Received: by 10.192.165.156 with SMTP id m28csp44754imm; Tue, 10 Apr 2018 16:03:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx48w/VNJoz7JwVUyCfYdzekv2RwiV8GI1jMQ5VEW3roK/LQK/Qs+0o99W+BY8ir0NrVOyg51 X-Received: by 2002:a17:902:362:: with SMTP id 89-v6mr2359679pld.270.1523401405700; Tue, 10 Apr 2018 16:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523401405; cv=none; d=google.com; s=arc-20160816; b=cVESESsBc6DS3qElPwcjHrAFHcL1AR7jVtxyC4DuwYsStZ1HrDrKkvAX+3FwBlqPcJ GzSzyFFd4lcYTdfNYm8bSr1IdecaUp7vHtx8D3bpdQ+uWLf9+ngHWOfscKb2XV9xn04t /0uh4sSQyyniC0kLCKJf6NrHZHXwn7wU6vQIWK+kLhyRhBZk328YJTR86NWJBKAsHUcG tflEz2NkWAj9ybsrROZoY3Uyd2OpLL4CH4Xb1ebaqrKBHUMy3JCGHllwqkVQSDh4Wvfa N2RSaGCAScFG79vgYgRurP9YzwSq/CpG6kKA0GY1vcccf1z5J/T3EmDBa+eg4zrxzNSm 6V6w== 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=VMP3YqSt44e1e8bigJw67npbb91AJrwWH0byfXDcggE=; b=lwPRpGPBlAqXYOj1n5AriZz9JqonPGlINXEXZqhRNSqNaYnxfrn11+b0fK2hFMYJZC JoB2Z0mtXYqEKDCUvLlKnr1r4AOEEuJrwkhYl6OThTcmAczJeUp74MpEJAfEBS5X/+pT MS3+7mMNweKr4c8iQK9NwXOgvYzj0aJi14eDy9sZz6JSnFxgEpoQCpzAJFeKUZuxwFYe YSIZ/QitTmTiz/PoY6oi6swAI9XrPjW7HMU8TgQwKDjSuckEctXhYVr9uKBwkYbJepGl ebkfeBu0fKZgS7vMt8NiEjgCXyI65SMk2D7ueM1kd6sNpnK2SgA3nddgjhdrfSGEb5CA qpYQ== 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 d63-v6si3583784pld.23.2018.04.10.16.02.49; Tue, 10 Apr 2018 16:03:25 -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 S1755791AbeDJWhH (ORCPT + 99 others); Tue, 10 Apr 2018 18:37:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43650 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755758AbeDJWhG (ORCPT ); Tue, 10 Apr 2018 18:37:06 -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 4016DBB6; Tue, 10 Apr 2018 22:37:05 +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.14 077/138] Input: goodix - disable IRQs while suspended Date: Wed, 11 Apr 2018 00:24:27 +0200 Message-Id: <20180410212911.088525899@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212902.121524696@linuxfoundation.org> References: <20180410212902.121524696@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: 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 @@ -808,8 +808,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); @@ -849,8 +851,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