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 49293C3276C for ; Thu, 2 Jan 2020 22:41:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1078220863 for ; Thu, 2 Jan 2020 22:41:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578004884; bh=yQaPYKQgh+LTD+y5wyvQ6MOmFZ2kc32fexLYKgvurRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1phIhcYmWwBFZaYpze8R4KiDDHoe7F7QhRj5zN61gHlryQHJRbouibse3Ny3G0ejR iWlwQ7uV0+0qKrj6sLnKw0V1Ffp4BwwLtc9Erxfb17d9ZfCzbwtjIXBkGqxUTQIrQN xfqvfGbx2+ioZIfBfKtn24c3xy7PdgmzQZ2HdgD8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731086AbgABWlV (ORCPT ); Thu, 2 Jan 2020 17:41:21 -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: 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 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