Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp4136235ybn; Fri, 27 Sep 2019 17:17:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxd5J6ohP0e2vqzYj5CKSmt5Ail0greRqMtq+4H8q3CeiA09bwLnytRoWzl2IDRqeBGPzWA X-Received: by 2002:a50:cc43:: with SMTP id n3mr7707783edi.250.1569629824985; Fri, 27 Sep 2019 17:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569629824; cv=none; d=google.com; s=arc-20160816; b=Ck2YjMTdSeLA8KcndH60pkiTX5z17TasfZE8rUAY0qGibL8Z0kEemJu9vhIKVXwTLy yX3vZtq64DhN/3y6yr4WzJTDbAU+ysoi2e4WECTKvlG+yz8EnvmUl2aGTHcOux6ebiBV PfczgmPg7TMoMfRK96HftMDwbtZxr5JGH7Jr223ho651S/dTaRIIp98fsb9qxPF/kD5Y 6ssumnS1rE0MlSOHomoQwWEBFO7PpLwRemvk/Bolhttvia+BbsGOEpNEaYC3MEItoClt D9vj1Wa8AKfml6PeGbus1wz+3/aOXVhNIlQ63g//1jHY0UyC61mY/IoulMhp8TJzx/3z V2Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=x5OtQT6idH9LaA0kReytId/54o5wnDaqSP4igHTa5XY=; b=Lq5Qca0kPevNAGh96WBYm/avNip100j90SkaloRm1RTWFohpvvakDq3DPkyBQWWXqN 2punl7n3AQVdMyJcTFusYuLXwcgDNZjWa1XTrVoHfDNk7s0FN98ieAPNxjS1d4q4fiu+ avw+93w14dHX/hjh/N4gQaaJ1hIX3NGkSKRwTM80YjplI/ZqP4hZIOQFQDSkXVMgtDzW AOmbpduFsB/oUxIARjk70RqNFEsQKVx4+iww0NdZ7W6LBnXBsegh8S/44BGx6HsYfr4A YrsTOBPIF62PooJRpiBV9WkEYs3mMyZ2hfFgMoNCf/s/KbYdcywBygikoM30C/GKsph2 RuEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e7BPZjEF; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b42si2591301eda.367.2019.09.27.17.16.37; Fri, 27 Sep 2019 17:17:04 -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=@gmail.com header.s=20161025 header.b=e7BPZjEF; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728267AbfI1AQc (ORCPT + 99 others); Fri, 27 Sep 2019 20:16:32 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:38265 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726673AbfI1AQc (ORCPT ); Fri, 27 Sep 2019 20:16:32 -0400 Received: by mail-pl1-f196.google.com with SMTP id w8so1217312plq.5; Fri, 27 Sep 2019 17:16:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=x5OtQT6idH9LaA0kReytId/54o5wnDaqSP4igHTa5XY=; b=e7BPZjEFn4/KUlv5Ovicz7B8+NjJVVxKI1DAuSojbyeqBZ21yHH03kDleRv3QH0SpJ XyBRkOLoflo3fYMxMLbyy8FZiPclujibOSGgwfLB2blGbhvz4Dyv0iHGbphWKHjxCJTg EUCf9CUg+bcwy+nW+PXgsDr7d4Tcopz2SbD6Ttmz/3RVbvvB4qFvLpigqN+tOi2SVT6p wDZ+3bjprPDQBMYhOzBiXV/jVl/GEo3MiTbWeAmacmMe9Andi0ORV/14eFAkgRAiyrgW 2dTXYk6KO4IwWGCwg3Liu+GLbqwiO7mSHsjPzGka4tZghhBgIGOdHXocxDQ00Cv4UtGz nW9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=x5OtQT6idH9LaA0kReytId/54o5wnDaqSP4igHTa5XY=; b=cxBUXTMN1E/LEBBJF7JjxUvbSAlhAPzuUGXKJUuuA7La9afWTT5O0lWqbVW5du/4vZ IZCvwzsMZ+opyub+jIBm3FdYNBQymKabeXyhcAMCjyczJE57Myl9s8IJEaA1EigyVt9r YScjAKFom0/YmurE9rm0S0rSxb28PbYIT8hD0daUE3CzzlyJWdKpqmzTh9t/c8uo166p 1//HYt3200gjfIp6Td+JT7hqH03qd+1aBHh9q+6RqH7fIvPZh0SPjruUyKTlU5tn5wHU g7C0pcO0xdS2eOinC1Lg1W6flMu1S+IznKY3+9be76uh2Uqq+73LmTQGy1l2LWMfzLXN Yhmw== X-Gm-Message-State: APjAAAUvcgCQM83uRgfTF1aqsSZ8oQlJ5zSYXHL5vxv17bVh+H50oWp5 E+nTLqgP7zNDuB10PxKi85M= X-Received: by 2002:a17:902:b08b:: with SMTP id p11mr7886498plr.320.1569629789779; Fri, 27 Sep 2019 17:16:29 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id k31sm6940665pjb.14.2019.09.27.17.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 17:16:29 -0700 (PDT) Date: Fri, 27 Sep 2019 17:16:26 -0700 From: Dmitry Torokhov To: Evan Green Cc: Nick Dyer , Jongpil Jung , Furquan Shaikh , Rajat Jain , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [PATCH v2] Input: atmel_mxt_ts - Disable IRQ across suspend Message-ID: <20190928001626.GT237523@dtor-ws> References: <20190924215238.184750-1-evgreen@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190924215238.184750-1-evgreen@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Evan, On Tue, Sep 24, 2019 at 02:52:38PM -0700, Evan Green wrote: > 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); At least for older devices that do soft reset on resume we need interrupts to already work when we call mxt_start(). In general, order of resume steps should mirror suspend. Thanks. -- Dmitry