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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 6D7B4C3276C for ; Thu, 2 Jan 2020 22:31:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41CC3227BF for ; Thu, 2 Jan 2020 22:31:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004286; bh=TthwAfsmb6SPtuYip6NvVbiF8b4sspXkblSL4VdWqDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Z5JB7heDtne4TgaCWkPuyb2VJnoxnKmJH/T7yqQsz7Wh6i7zaMPSOfkcqCaeiefeA Z+IOYA0ol1pPoNktk9GP+k0hca/4sgegY8hi8w5m4pj0rYhWyhd/ZJD/T9v95OgkQK /N+RUNqZCSBoEjAUa9Xz5rZg6VqkQMQ7j4lzPXU8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730026AbgABWbY (ORCPT ); Thu, 2 Jan 2020 17:31:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:36408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727846AbgABWbU (ORCPT ); Thu, 2 Jan 2020 17:31:20 -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 6F52B222C3; Thu, 2 Jan 2020 22:31:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004279; bh=TthwAfsmb6SPtuYip6NvVbiF8b4sspXkblSL4VdWqDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=irPeTtinYuN6T/SmUnGAD/enC1br4o95ci9bW8I+sORIVcAgB2AhK4mjHMyWdZVuj 9IXWEwLP0JdPd+oPwweOOemCQXsZvmA8UQlf6eZFrHPnnzduic0fzYgOaXy8/8uwzT ig3BJg0qowa1ai5Njie+ZPfd9feztsTvTtB2Burk= 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.9 113/171] Input: atmel_mxt_ts - disable IRQ across suspend Date: Thu, 2 Jan 2020 23:07:24 +0100 Message-Id: <20200102220602.820154792@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220546.960200039@linuxfoundation.org> References: <20200102220546.960200039@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 c2fb0236a47c..8d871fcb7912 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -3206,6 +3206,8 @@ static int __maybe_unused mxt_suspend(struct device *dev) mutex_unlock(&input_dev->mutex); + disable_irq(data->irq); + return 0; } @@ -3218,6 +3220,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