Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4588250pxf; Tue, 23 Mar 2021 14:39:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxL9ymLw7CxcoZeEAdF7Hu62FAxRFsTahoFSQg/ODefiCHl5Tqhjjhm+PnF9dQXZ1nI60uD X-Received: by 2002:a17:907:c16:: with SMTP id ga22mr265849ejc.120.1616535571321; Tue, 23 Mar 2021 14:39:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616535571; cv=none; d=google.com; s=arc-20160816; b=WyFt6UyZA63sCeyYYc3YwyVUA5MtDUtlrl9xFywRWduW4xRlLW1UN7jzhvLqljeUo4 fuTvZy7WDW6JJOLzfs8kKYlyBySm5ielvRL3fZLrRzJh8BJbhRDGptxyoHKOJN7ChIUb inVwXc5lilpB/04Tg7M3tLockS/XHGNb7M20/0Mc6rqMV/396HeaEgvkUaoUNPW8fSGw W65eR5ZolbOQFEm4iRocoD6PKBW03ejKILBrK74711bPX+GnugipZyUF7JkSYCO7jd0B aUEIY5TjdE1fgOAGos+L5YijW4nzmXqwVFUUgZR4p4OO+kleSorSi8gGFUDnZo5uP7/H PH3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=XzV5iTFFRxwiIThTNNC9D1IR/At6zFkZ2wYh9lkF1SU=; b=l8cwG6+EmWuwfRaRUzYiRARpagUO+bHHsFQxwmWiFsR5lePYZwgHiMOUDmS8dYmzQT Ybzcd9K3O/xiZJUkN8Y5bNTdC7FwlVtG+1GGUAXPODvt54n6wvWJ0u5U5My1fqsbZKO/ 3coTZNlw48YIO0G7KpO6b+SwakdElXYeCNQ/dwkH5VfM1Lo2otEwF5lysosGx/o7DoNP ZNYf9zBJQAI0TQVHCwysjSgsD2o+e5/dfZxQlNwbfmYplbabZq/OjTTQEgLX13d6KMJL YSEJMw+bjjvTDxkpqUnMfTFGAMtnJnc3PEgLmZa32IC7pHlXMoAh5g99GFHBx2XgggmJ hCrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jy7FC4M+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id z18si174347edb.55.2021.03.23.14.39.07; Tue, 23 Mar 2021 14:39:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jy7FC4M+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233629AbhCWVe5 (ORCPT + 99 others); Tue, 23 Mar 2021 17:34:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233614AbhCWVeg (ORCPT ); Tue, 23 Mar 2021 17:34:36 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADD9CC061574; Tue, 23 Mar 2021 14:34:36 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id s21so10687418pjq.1; Tue, 23 Mar 2021 14:34:36 -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; bh=XzV5iTFFRxwiIThTNNC9D1IR/At6zFkZ2wYh9lkF1SU=; b=Jy7FC4M+wnWAOhFPxob1iQf1L5XGBjCj2qlrDLgjeDXvk/+kWeFghSYsmlkG7Hxoc1 0i+aCswR0sETqik3aTEuE2u8aVoeo8vNhT++VHXoHdy2tmBNvWh9jCRzGGo3WRS3yzPl 4fr3+OiPEjWDDZPc64/yV0yw6RSOLtsWBWgBnhVJMTPRihCcR021Eu1oGqHmxuRheq5/ 1afh6TzMB4XOb27SZiZ38lL9Tk9hEVz+O1lkhNIauMRAn3u9XsPjNGQpLvJBop2FhbtW Zhec0LJ1YgzXqOn2XNb/NXXnVPhjy6x9dvnDSSl24RBQZ8b26qK71rPHyjzISo9Uiv2a G7eQ== 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; bh=XzV5iTFFRxwiIThTNNC9D1IR/At6zFkZ2wYh9lkF1SU=; b=Zwmi3aqKpYzEUg4XvqsyznCaVkRYu3BJw9E5BbqkVtKSy5Cvt8opTVW77izKneZgI+ IWvujZarmfU6lf4s/7aq+eL3+eF0EABNi4MD3HPApMoLkAYXrMSJgAMSEQ7P8qgLnoIy m+8w5mUePSNCq4hio/3sFMMEoZZWGOUvu0+Uyf+CDd5xpgdFkELvufTHyA68lS9alPPi m5pJpMBxudqQMOsHhkcql4wYTpJCuMKb/4ND1WBvbNcS+vdMid5g69WpBq58Z8lbIeTW YZIiKuMDIdFDqEXtYr0F4YC8NxAtcFHmMM8Un09n1iaBtqTnN8tEuwX1NHCiE8iQrj5y skuw== X-Gm-Message-State: AOAM530TYnFmfbS7wOw0jYd+dPC60eRt8QtwDg0JLnggiaA95Lw+QA3+ B5369HV64RedWX7VmK5Fmps= X-Received: by 2002:a17:90a:a503:: with SMTP id a3mr104638pjq.235.1616535276278; Tue, 23 Mar 2021 14:34:36 -0700 (PDT) Received: from google.com ([2620:15c:202:201:4d6b:ca5a:c720:f5c9]) by smtp.gmail.com with ESMTPSA id a22sm146699pgw.52.2021.03.23.14.34.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 14:34:35 -0700 (PDT) Date: Tue, 23 Mar 2021 14:34:32 -0700 From: Dmitry Torokhov To: Paul Cercueil Cc: od@zcrc.me, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/3] input: gpio-keys: Use hrtimer for software debounce, if possible Message-ID: References: <20210307222240.380583-1-paul@crapouillou.net> <20210307222240.380583-3-paul@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210307222240.380583-3-paul@crapouillou.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 07, 2021 at 10:22:40PM +0000, Paul Cercueil wrote: > We want to be able to report the input event as soon as the debounce > delay elapsed. However, the current code does not really ensure that, > as it uses the jiffies-based schedule_delayed_work() API. With a small > enough HZ value (HZ <= 100), this results in some input events being > lost, when a key is quickly pressed then released (on a human's time > scale). > > Switching to hrtimers fixes this issue, and will work even on extremely > low HZ values (tested at HZ=24). This is however only possible if > reading the GPIO is possible without sleeping. If this condition is not > met, the previous approach of using a jiffies-based timer is taken. > > Signed-off-by: Paul Cercueil Applied with minor edits to make more use of debounce_use_hrtimer flag. Thanks. -- Dmitry