Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1813002ybj; Sun, 22 Sep 2019 12:30:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFX8Vm0SkbTHDAtWQlZH6s3Bqs9lXr/CnmhI3YqIP6eEl2a5DyXLDKPIDJrMjj+NZkGsN1 X-Received: by 2002:a17:906:52d8:: with SMTP id w24mr6594639ejn.6.1569180658702; Sun, 22 Sep 2019 12:30:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569180658; cv=none; d=google.com; s=arc-20160816; b=c7+h2/kb9qSZqgMksLYP8ix5pLLHJqyWw6P7ap5m6/y6Q0C/k117bgaSqZHa68XmrN P7ICG0lc7bD90F1vDSZfivCIoxr50kTmvCXfwd/wN5OSt+1w4nKeD/BZQCws+WtMWdz3 AtmKn4mwZF7xoHngtdWqBKlJqWEcbVEexolNwe39wWkwqf0DQwzCjf6MO+CiOyAi5fqo /8b/wLA18AtQff+Edl6pqmhHUlHnoFXpInVIM1dlA7UsgwwRztDw1sw8TkBiKHcGhjNQ QTCUPOXoKHokNpFs6cyRJHNF0ybk0wVSE1V6Mii2JnYo5452WbqZdnulXCqBv2H4WX5s toAg== 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; bh=kga6M+TDrjrhlSWxRRDFCOOV9VH0QLD/1rjmJBIU9+g=; b=fJ8Kw8RNQidBuVV0IVSHf3s8kIzdiMpchppI4nfLEfiqUKgtDocU0y8zYLsiFhiTrc jP1Mo6sKIrSXoQXA+/rTncXzEdbAO72eEnBdF/H4Dm/ssTjMh0tNkwSrQNJRHMctwWpC wwlOdzKfmoqVHvIJb7CnmS6yZFeXDK3Hb4oWeU3KKPi03yOsYriEAtrP+vm4Tml0kDzI ksa60It+dJgnAzTGqQ0M2wYa7H8BP890AE0TpiEujAxXXGxGHjhO2MTrqaeutY1yZBDY JklqH2M7+MY/oV5svXqNaZE7jXLlgvdMFlK0kvQPYwhDEJaEFm6gpPeQiTSETLqfvbMl 6u4Q== ARC-Authentication-Results: i=1; mx.google.com; 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 x45si1374832edd.388.2019.09.22.12.30.34; Sun, 22 Sep 2019 12:30:58 -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; 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 S2387730AbfIVQOm (ORCPT + 99 others); Sun, 22 Sep 2019 12:14:42 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:46896 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387471AbfIVQOl (ORCPT ); Sun, 22 Sep 2019 12:14:41 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 5181D8039C; Sun, 22 Sep 2019 18:14:25 +0200 (CEST) Date: Sun, 22 Sep 2019 18:14:33 +0200 From: Pavel Machek To: Anson Huang Cc: Dmitry Torokhov , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "shawnguo@kernel.org" , "s.hauer@pengutronix.de" , "kernel@pengutronix.de" , "festevam@gmail.com" , "catalin.marinas@arm.com" , "will@kernel.org" , Aisheng Dong , "ulf.hansson@linaro.org" , Andy Duan , Peng Fan , Leonard Crestez , Daniel Baluta , "olof@lixom.net" , "mripard@kernel.org" , "arnd@arndb.de" , "jagan@amarulasolutions.com" , "dinguyen@kernel.org" , "bjorn.andersson@linaro.org" , "marcin.juszkiewicz@linaro.org" , "andriy.shevchenko@linux.intel.com" , "yuehaibing@huawei.com" , "cw00.choi@samsung.com" , "enric.balletbo@collabora.com" , "m.felsch@pengutronix.de" , Jacky Bai , "ronald@innovation.ch" , "stefan@agner.ch" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-input@vger.kernel.org" , dl-linux-imx Subject: Re: [PATCH V4 2/5] input: keyboard: imx_sc: Add i.MX system controller key support Message-ID: <20190922161432.GE1999@bug> References: <1568602373-14164-1-git-send-email-Anson.Huang@nxp.com> <1568602373-14164-2-git-send-email-Anson.Huang@nxp.com> <20190916235330.GI237523@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > > + ret = imx_scu_call_rpc(priv->key_ipc_handle, &msg, true); > > > + if (ret) { > > > + dev_err(&input->dev, "read imx sc key failed, ret %d\n", ret); > > > + return; > > > + } > > > + > > > + state = (bool)msg.state; > > > + > > > + if (!state && !priv->keystate) > > > + state = true; > > > > This needs an explanation please. > > This is to handle the quick press of button, e.g., when button is pressed and released very quickly, > when the delay work is scheduled, the button state read from SCU FW is actually a release state (0), > the press state is (1), so the quick press/release will be ignored. > > However, after double check and test, I think this should be handled by debounce time, if the button is pressed/release > very quickly, the event should be ignored, I will remove it and reduce the debounce time to 30mS, previous 100mS > is too long, using 30mS as debounce time, I did NOT see similar issue no matter how quick I press/release the button. Are you sure this is expected behaviour? AFAIK microswitches can bounce when the button is pressed and released, but will not generate glitches when the button was not pressed, so even short presses are real and should be propagated... Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html