Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1773045ybn; Thu, 26 Sep 2019 01:55:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwW6b6X1ye/Re42aUZpZ/qZBw/dl48TxWTiCww6qQ8g7X4px/ZBn/Ol53h4Fgo5ieQYDP22 X-Received: by 2002:aa7:c749:: with SMTP id c9mr2354533eds.232.1569488101308; Thu, 26 Sep 2019 01:55:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569488101; cv=none; d=google.com; s=arc-20160816; b=0Ir8y0t6fWRlQ875U8zq4YDroYvRsHT5lBA2xGz+/nwtjyINN5iMxADvBFcLWj4fq1 cn6qNyfXaWnDGfMvPF7kxD0y296VJw1W3LIU68/aLt7H3ChpybgqDGquekBH64nf/Bg0 p5evEYlsVIrZiht5KH8k9Mr7zTRqaQ/fbIpcTFWYK9DydoIT/TYIw/81jmdbsPYYkQpN nnzbi6Sna8WdjPtByySqklQ9IjOOLJGec8ChruO9yrb8OBrp+kdbI+4nVoKHOM/xQtPq hOcwccROtQjuTAjUORPWlQ5tepjN8yef/FybyvCBaJGrH/OUTbTLNecJJT47hsGK7wOI 7+XA== 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=+fhJ9T/vZjSSX05VHp18SVR0XFnj5tZksc8z2VAuz54=; b=HY9f0iP1loc91XmouLfQC09F2zbmzjFUG0BKDOidUe6WUNA0OJFVw5Pk+WUfbOTqhk SZRZn69xigp6BrV46CHSQauowU9mSQHJ/PYQFqvaGk1g5ziKOJuYstdXHAYdc62eYqBC W7bHr0RKZl+GXhDy5uzbmCv8WDii+htBJPHt2xKthPKsGBTQ99mDG9/Qf8tlNeckmPLB GFWRZJH0JRmQhGRtJr/QtZRx2a6mEUEm+xm2A0vRBsuNzmTcXYcp20PHvg5mZOaXwYsf GoF4aleHbesSt7tuVwMfZWlkj0ED+2IAdVyAg+Mu57hoTokUvtvxN09edvAo6nzubhSP YDqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OFC1szf5; 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 m12si615669ejr.180.2019.09.26.01.54.38; Thu, 26 Sep 2019 01:55:01 -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=OFC1szf5; 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 S2439080AbfIXVwo (ORCPT + 99 others); Tue, 24 Sep 2019 17:52:44 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40245 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728183AbfIXVwo (ORCPT ); Tue, 24 Sep 2019 17:52:44 -0400 Received: by mail-pf1-f194.google.com with SMTP id x127so2111905pfb.7 for ; Tue, 24 Sep 2019 14:52:44 -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=+fhJ9T/vZjSSX05VHp18SVR0XFnj5tZksc8z2VAuz54=; b=OFC1szf5PoQuT5vyg4Il+WGjsj/nKDC3/5I83EXRYroN4p+0LcCQNVXZ1Dczng+l/9 mX0OgMcBO2ic+gGiP5KR3IqB8DXh9UeF13m6c15qdDEuA7foGI5jv2h6XOlk7iSwSAww 9xyXErYkzTDlxbmY4plb2PXQnB5uWqu/47bX0= 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=+fhJ9T/vZjSSX05VHp18SVR0XFnj5tZksc8z2VAuz54=; b=KomZ5MTpBG2pD3nLB8k02Atmlddt4ccZbpYkFu7rT1NlTymo5J+LVvq0Rz28LIXwxF echRIo4OKbLubOIH+i+sNcLG8mYw0A8FPmjuNqGCtm5rUrSS7ZfLuad6bEYtzT1qgLc5 hhZJwaCnsf9EOPdfR8p2B0FOFRXCz+x3Y8/xFNy4i3ao/xQuEuptCdNz0WYi/f0FhmrA stE4U+iMBMwZP2rj4/z3dq6a535F/YNz2GXGr6PUF+4QHpai4gvFFjNSCirCJIJ75jng nRZ2FrX4bA5E5GQIwnQDfw5EapIcXvTAWGbFP9P3rgVuzrc55m4cDPRBCF6/BR17vYkW 4DqA== X-Gm-Message-State: APjAAAULSIOYuu6u3LyPm9OgAU5n6nRl4DJJHV9yn/qmBVkCktifUhbU q/M3hrUvFBI477Uz33MOEzMcZQ== X-Received: by 2002:a63:a548:: with SMTP id r8mr4828285pgu.401.1569361963764; Tue, 24 Sep 2019 14:52:43 -0700 (PDT) Received: from evgreen2.mtv.corp.google.com ([2620:15c:202:201:ffda:7716:9afc:1301]) by smtp.gmail.com with ESMTPSA id q204sm2494493pfc.11.2019.09.24.14.52.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 24 Sep 2019 14:52:43 -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 v2] Input: atmel_mxt_ts - Disable IRQ across suspend Date: Tue, 24 Sep 2019 14:52:38 -0700 Message-Id: <20190924215238.184750-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 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..a58092488679 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; } @@ -3174,6 +3175,7 @@ static int __maybe_unused mxt_resume(struct device *dev) mxt_start(data); mutex_unlock(&input_dev->mutex); + enable_irq(data->irq); return 0; } -- 2.21.0