Received: by 2002:a17:90a:9103:0:0:0:0 with SMTP id k3csp11802466pjo; Thu, 2 Jan 2020 14:32:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxBtm+Vnmjcp6xM/OGFn0lpVzXcqoaOEdkBN3xT3nXqHK/Jc0btrHnD0EgEbTpb9HGQp+aa X-Received: by 2002:a05:6830:1e67:: with SMTP id m7mr91612276otr.262.1578004347217; Thu, 02 Jan 2020 14:32:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578004347; cv=none; d=google.com; s=arc-20160816; b=zCoJOfmLw5smy+ZBJWoS7URwESt63SDMy1Re9uvvc3qexB7XUZNpWmh6b+KH8JyXr/ VLu3OKrMnfhC4IJrlng6vnWZMc0f2016tVhXC6T0sSK49LUEb59bbz1R/OXLLTmiqD29 dTi1txVm4JM/dqBW5P5HJoVEh7kJwFZgYCWfCEzhUbshPEWt6rL0ILHYLS8xE3L8coeY MssnW1CWjIOeOGBEM5TRcJQAzgTerH+QaS330aKS5x44LBkD6XGvXSQe9p2acOlh+Rhw Bpq9kAlH1dBbvNBjfkp20dCkiVdUIQSTpwIfsPiP57f+3qm0BWWWSV59JWBh9Pa8gHo5 RH4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rhjU3RpswRo8o66GdnfZjQZUJ+En+tCwo68t/ZX4YlY=; b=YBqahCJbCQgTh72OWNSd9k2fUGfCrhWIChiVdG5P6n7DFY6PNCIjec7KwzEAYH7Zip rYB9o2A0PAtcc24hLI+tI+CL12XN7idsInlnvQr8Zr14NSEqBqQYBm3KXBrcKfyoNJHZ 6fycB58SZgoKmXF8fweuBAGHPVQMJ33EK1fSW9wgC/deUUzYGbqQ2uP+0jZbisLYi7KG BHa+6rYrA1aGyNLXRUCdvJlA79i88n5UusqpwOEZOsY/XfnrB62J062GqvuLb/fmvUj9 vKG5yPlpDWkoLk0viuzm4ltLEH02VLf4ajQ/h71PCyUR7wxx8YzuReBK984vJbQ6h7UN GXbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=irPeTtin; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13si29504615otq.146.2020.01.02.14.32.15; Thu, 02 Jan 2020 14:32:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=irPeTtin; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728328AbgABWbY (ORCPT + 99 others); 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