Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11813146pjo; Thu, 2 Jan 2020 14:43:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwcnuS/hfWMEFHu0NUSbLEjmN7w68bsRXQgNOAld/+4bYjHSbv+cwhTjZUiTDjLrfnq98nn X-Received: by 2002:a05:6830:184:: with SMTP id q4mr77936154ota.232.1578005020696; Thu, 02 Jan 2020 14:43:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005020; cv=none; d=google.com; s=arc-20160816; b=nEG6u0+ZpBCOM3Ekkeq/G/JStFw37nqrwJ3Hvbcsk6KYao+nsvqowV5y/VZ+BVfWDg twYMYsIXg3GmVCdUb6fisf/J9fj0CLqaZYVotimEpiDvFz0vlGSYbWfnRjH7sXkWlP6+ lqg87m7zF+kRYch4o0w/ZBX45srIFz1KJIo2jZGSfy+Oi+vPyeQ3SPI6kogwf42LQ4XW Nt6ccnfUQg7h5diT6oC9lRmU4Hxg/jLoxZbB6r0krRobdRQBA6P692fvnZs3zVGIfbBw Y9zY0ZSV4xLAqh7ZEVpG0wU8RKoPlmROGY4FQyO3KMB1M546kyOpashHtQoIZqvW0OZE YiCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iijQZpZ0r6i8/jATYXTqxQL7WgELzJIpL9tf6AdCmDA=; b=uqEv04Y1mPCP0DnfzT1vJhks+aDnLiPCDtKyDg1pi4bpCGInmk0v+UnvP/Lb2jCNHB sEJkuUGG3oK8CRsoHV9ARrCEPcJQt3rbzIyybS+4xOC8jOnIQXXdliKFn0Q6zYM/bvNN T/ew4wVpPWZn0IILEUY/XCGaiookhbx12ODZObM9FH9MFVin7vyOilrXm86ARGW+4xwT rSm1BUW414aAKxxCPIJqcPir6ws3tyvtdfUk1Ur/PXVYW4YB/wtIY0yr3Q79/mn3Bz0R jlyPRa7Ioz6X47Eu4lWsHNtBOxWerTWt5ivi6CV+y8PaC2QjarxMr6lGtOAjGYF8Hi5g Zg4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EQGUSoWe; 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 44si30200494otu.77.2020.01.02.14.43.28; Thu, 02 Jan 2020 14:43:40 -0800 (PST) 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=@kernel.org header.s=default header.b=EQGUSoWe; 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 S1731242AbgABWlX (ORCPT + 99 others); Thu, 2 Jan 2020 17:41:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:49758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727282AbgABWhV (ORCPT ); Thu, 2 Jan 2020 17:37:21 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D096217F4; Thu, 2 Jan 2020 22:37:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004640; bh=yQaPYKQgh+LTD+y5wyvQ6MOmFZ2kc32fexLYKgvurRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EQGUSoWeHKnn4RCOtWndgwHfnkr6Ia64rSSGF27SRK9OqRMi5bmAKAoSExnkGnTNf SSh+EueKdPS8INHkDwzBax01J3197+zACPepAxlRic2+iMQbtOEwpaUgyGxSrvfDBD YEDXmLacM8F2zs4OnT8K7/ep+u5V3spc2KycBJEk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Green , Dmitry Torokhov , Sasha Levin Subject: [PATCH 4.4 092/137] Input: atmel_mxt_ts - disable IRQ across suspend Date: Thu, 2 Jan 2020 23:07:45 +0100 Message-Id: <20200102220559.219860390@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.618583146@linuxfoundation.org> References: <20200102220546.618583146@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Evan Green [ Upstream commit 463fa44eec2fef50d111ed0199cf593235065c04 ] Across suspend and resume, we are seeing error messages like the following: atmel_mxt_ts i2c-PRP0001:00: __mxt_read_reg: i2c transfer failed (-121) atmel_mxt_ts i2c-PRP0001:00: Failed to read T44 and T5 (-121) This occurs because the driver leaves its IRQ enabled. Upon resume, there is an IRQ pending, but the interrupt is serviced before both the driver and the underlying I2C bus have been resumed. This causes EREMOTEIO errors. Disable the IRQ in suspend, and re-enable it on resume. If there are cases where the driver enters suspend with interrupts disabled, that's a bug we should fix separately. Signed-off-by: Evan Green Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin --- drivers/input/touchscreen/atmel_mxt_ts.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index be2f2521c1c5..d955841da57d 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -2701,6 +2701,8 @@ static int __maybe_unused mxt_suspend(struct device *dev) mutex_unlock(&input_dev->mutex); + disable_irq(data->irq); + return 0; } @@ -2713,6 +2715,8 @@ static int __maybe_unused mxt_resume(struct device *dev) if (!input_dev) return 0; + enable_irq(data->irq); + mutex_lock(&input_dev->mutex); if (input_dev->users) -- 2.20.1