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=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 80730C3276C for ; Thu, 2 Jan 2020 22:51:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C61420848 for ; Thu, 2 Jan 2020 22:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578005479; bh=oVwTf1C/yabIoOxrk2K4gKq/YQtGQJRmTDX44jNet1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hKyLytsRjqU1SQN6bb30EVw25fNEPIVavu/8Lds3JM5zRWPYyVxle/pGT8MSplAfa wJdrmct8p70rKqnpyQzZQPvSsc7NsHI7WcC3n4dHLXEtJ/KsPz5EvumCHH7HTjCJYf 8FaZleQSJ93H2KO/MCxbXsfW7ct5kaLSdNFzMTrU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729386AbgABWYU (ORCPT ); Thu, 2 Jan 2020 17:24:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:47960 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729375AbgABWYQ (ORCPT ); Thu, 2 Jan 2020 17:24: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 6137E20863; Thu, 2 Jan 2020 22:24:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003855; bh=oVwTf1C/yabIoOxrk2K4gKq/YQtGQJRmTDX44jNet1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=loZR1a2KNjhDyT40G9yS4g4z4wWiBUC0TjHUfp4ZH0JD6X5PQJAm18WOb9FfxtIyb WuyENSQDUytqaBW8NME0LHpmXmZ3HJWu06a2VgwbuBA7GWKfxgSVIacm3vy+Uw6ZNz G8djj/GYj82fASo7+0ELHByLyhOOxGqXfD8n6Q3M= 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.14 04/91] Input: atmel_mxt_ts - disable IRQ across suspend Date: Thu, 2 Jan 2020 23:06:46 +0100 Message-Id: <20200102220402.321876076@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220356.856162165@linuxfoundation.org> References: <20200102220356.856162165@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 59aaac43db91..138d1f3b12b2 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