From patchwork Thu Jan 2 22:04:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 234809 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=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 6A3DDC3276D for ; Thu, 2 Jan 2020 22:11:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3FD32222C3 for ; Thu, 2 Jan 2020 22:11:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003080; bh=5vUWgrj5vLEdHZ9jl28RNg9+DpDqTfRnl9ZrpIKoLBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jEA83lPuuiLnu9DTsQL3YIAd+q7ehixSZwBQ3ZkxrFA8W7U+TDgBQXfbzCSIOeLJj XHQdg5MQKyEp2QNyEqbJUupguqKMU0kd61k7vtf+2a0NrP843p+Cu5MyNgP1S5k6Y6 oNEVOr7VpJd2u/6ehCIuMu7ZlS9fjZYTqmI5RHf8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726089AbgABWLR (ORCPT ); Thu, 2 Jan 2020 17:11:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:49196 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbgABWLQ (ORCPT ); Thu, 2 Jan 2020 17:11:16 -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 CA90621835; Thu, 2 Jan 2020 22:11:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003076; bh=5vUWgrj5vLEdHZ9jl28RNg9+DpDqTfRnl9ZrpIKoLBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vpDPA8/7f8PcqRQlE+yZCpXvsl8UyruFoXvZbvr+Dmr/EykD8bUbhJkZxvAh/FJtH /f0oFn91Q7c+60EE/KmfcAFf7w5dgZ+CBBo1QavEX+6ygoMmaJxNCO+7bH1Iaj5FuO Fl0MojUROxe2w2hpuzqf+lOqxgqhUqbLdV18RxB0= 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 5.4 010/191] Input: atmel_mxt_ts - disable IRQ across suspend Date: Thu, 2 Jan 2020 23:04:52 +0100 Message-Id: <20200102215830.854609108@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102215829.911231638@linuxfoundation.org> References: <20200102215829.911231638@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 24c4b691b1c9..ae60442efda0 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -3156,6 +3156,8 @@ static int __maybe_unused mxt_suspend(struct device *dev) mutex_unlock(&input_dev->mutex); + disable_irq(data->irq); + return 0; } @@ -3168,6 +3170,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)