From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B326AC43603 for ; Wed, 11 Dec 2019 15:33:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E82B2173E for ; Wed, 11 Dec 2019 15:33:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576078439; bh=8Dp5vO8kcbrh3KhIsu66zXmDE9ethp1hfgm/B8PiLOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=KPG9DoXl/RozqUHeibgiiYQGApwXSzlIMMxesXr9hBnj6DmkzjnWme7g46+mKHeay Tv8RlnD5Vn+3BSu1SQfHVmKVGog2QKdlUkYTEulrquQcp+zhPbQI3mzVYepRCJjCSV kGDkpJUnbR3L0THUjGYrJA34FW4aTS0CACwjLYuk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387677AbfLKP2i (ORCPT ); Wed, 11 Dec 2019 10:28:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:34850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387671AbfLKP2h (ORCPT ); Wed, 11 Dec 2019 10:28:37 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E543E2467A; Wed, 11 Dec 2019 15:28:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576078116; bh=8Dp5vO8kcbrh3KhIsu66zXmDE9ethp1hfgm/B8PiLOI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iDXInvl2yAhwMZD8Bp0SaV3JJctobmzu7TGlv2n9PTz58c0udlA4UQTWr4aG4EGTl LCmZh/YrhqHopOCNO/yfZHnWW/Tr8pdwYGnaD+Nid60I0VhKRzk20p/AtpqrFYpEPa 4nYLcUgI7wFqWfnWBoseywn3/EE0wwsc4Qw81sMs= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Evan Green , Dmitry Torokhov , Sasha Levin , linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 04/58] Input: atmel_mxt_ts - disable IRQ across suspend Date: Wed, 11 Dec 2019 10:27:37 -0500 Message-Id: <20191211152831.23507-4-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191211152831.23507-1-sashal@kernel.org> References: <20191211152831.23507-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@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 59aaac43db91f..138d1f3b12b2e 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -3257,6 +3257,8 @@ static int __maybe_unused mxt_suspend(struct device *dev) mutex_unlock(&input_dev->mutex); + disable_irq(data->irq); + return 0; } @@ -3269,6 +3271,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