Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8661972ybn; Tue, 1 Oct 2019 11:17:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwTgDoXJpeLnwIUxvN3SN7NdQWNtYaJlUiU6IE0wDigrHHOrEEIE6aLJiXz+2tA3a4KRfV X-Received: by 2002:aa7:cd18:: with SMTP id b24mr27007734edw.181.1569953830967; Tue, 01 Oct 2019 11:17:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569953830; cv=none; d=google.com; s=arc-20160816; b=l2bI7JlJ0TcScA0Q56QlHLMrzT/hqxnACT9ZyBazBIj6lTphcQALBXaJlW5puZS/pr XAfBvTyXBgpqkoh8wlNl5Rih0lTcdGpYqf0KHeH8CVvklX5kAR0MWaGOE0GBhbtbQQK8 V6iziUczL7PKm/ouEHudpZJXEYB/vm/cNmTlgZcOUa6TyDa/CewxXrPY/rq3Fy1fJXGd QUUOnhT0oRpahUe3lgRLx/x1zjXsFSDTvTGSzu51zUROFy+vioKrP781e3iDwYFtP9gJ sO+kz4D9zknEOSPK63/cwb429RQhSp2ULIdbY6s5OL/OplNb4Hv7szp40mfq/pIFj/x9 A1bA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=H4Th4IEXCL9ir74s2zgWbQ/AH3VtZ8QsHbxgUcgvt2Q=; b=gAgyGyykKdXDgtiuY2z22rLIsz1gwRinrbX/tFldVsUuhRTc84evY0VG7ypx12NerS yOzqxTjayh09xL26r29322T4uvw2FdIc60oXRSA8XxMDTPWXcE5rJW2+mbpvbYcULtNt hn+5LpoVZ3taDIrSFdNV3OX5qxkTcK9VNXbxXR6IvIpLul5RabdI0n6jSSCIZI+9GYLW ttkj2gMsblpYkF+5He0u3hL3ScGvjSnhrSvj5wK5WPZegWsHqZWZkYrhiHu9+pmTTZ19 gLxwyLGcjpEq/uYok6FeTdx+aTmXv4pQo9Q9hxqOyIB6xd1DN6xoyEe7WQeQu8jHB4QK IJ4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Dwdw0/Gj"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3si9241426edq.163.2019.10.01.11.16.45; Tue, 01 Oct 2019 11:17:10 -0700 (PDT) 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=@chromium.org header.s=google header.b="Dwdw0/Gj"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732051AbfJASPO (ORCPT + 99 others); Tue, 1 Oct 2019 14:15:14 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:34271 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730769AbfJASPO (ORCPT ); Tue, 1 Oct 2019 14:15:14 -0400 Received: by mail-pf1-f196.google.com with SMTP id b128so8636848pfa.1 for ; Tue, 01 Oct 2019 11:15:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H4Th4IEXCL9ir74s2zgWbQ/AH3VtZ8QsHbxgUcgvt2Q=; b=Dwdw0/GjhFwZckV674siggVRHgb7S6C50hRRYg+2+KNYSa2oH49DY2/6NftHuFlM+2 cE27+C2Im1lagPA534PGPBBWfXKFHt34qH4scjbp9ORk7thOX6EHbtLLq0Cai8NVLHVv YymSErGty/wqCDittZB/zXXZxReMeF091wPnk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=H4Th4IEXCL9ir74s2zgWbQ/AH3VtZ8QsHbxgUcgvt2Q=; b=K2oNRJx/lut5eqwd1d8aI5WgkUg2uwQHYTIU85/w74yna4OpnHLpf8ZGPhBcd63Fbj UjURYLNBXdQ8eFzx1z11QxQZXGi0BTyzmm63QsxXVFElsylcZ4YpQwYuY3bQ0tCXk7Ce N7Xz/RwgJPSjUrdvSPQiAoXpjR9PPh+I77BLF1rmPuSht55x9vwo6RO7/qaCxOCoB6+v tKKYEjds8cVSmGCDigfiCHiBWngTqMdV4GwW4mI0wIL9YRmVwrPMlajO+r7BmlizgNYz Zy+hlx+TOl5Hx9Q3WWCE6oJqCx0Q+E821nejvISnv5KeIJBUjq0eRNpXQiIzSo4NJGcv VITQ== X-Gm-Message-State: APjAAAWyOUB4KXvv2mD1GTl64oF2L5kEajJv9bQzQJnGXRJf2afb0fpV aUncY2GhgoMarbA3hbIhoDTYrA== X-Received: by 2002:a63:9a11:: with SMTP id o17mr31176218pge.434.1569953713481; Tue, 01 Oct 2019 11:15:13 -0700 (PDT) Received: from evgreen2.mtv.corp.google.com ([2620:15c:202:201:ffda:7716:9afc:1301]) by smtp.gmail.com with ESMTPSA id dw19sm3449074pjb.27.2019.10.01.11.15.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Oct 2019 11:15:12 -0700 (PDT) From: Evan Green To: Nick Dyer , Dmitry Torokhov Cc: Jongpil Jung , Furquan Shaikh , Rajat Jain , Evan Green , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH v3] Input: atmel_mxt_ts - Disable IRQ across suspend Date: Tue, 1 Oct 2019 11:15:03 -0700 Message-Id: <20191001181504.207486-1-evgreen@chromium.org> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Changes in v3: - Move enable_irq to the beginning of resume (Dmitry) Changes in v2: - Enable and disable unconditionally (Dmitry) drivers/input/touchscreen/atmel_mxt_ts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 24c4b691b1c9..1627fcb27f35 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -3155,6 +3155,7 @@ static int __maybe_unused mxt_suspend(struct device *dev) mxt_stop(data); mutex_unlock(&input_dev->mutex); + disable_irq(data->irq); return 0; } @@ -3168,6 +3169,7 @@ 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.21.0