Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp486047imu; Sat, 15 Dec 2018 01:07:25 -0800 (PST) X-Google-Smtp-Source: AFSGD/VxzosASi6WHg1PdnlIvRV81j5mlBiYgi0bjj8xxi+OdoE4IjbE6KPky/LtjsxtZyeaeqi5 X-Received: by 2002:a63:5c41:: with SMTP id n1mr5238367pgm.1.1544864845622; Sat, 15 Dec 2018 01:07:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544864845; cv=none; d=google.com; s=arc-20160816; b=LCCrELsLRmfY3s3LH51YUbmw+Nbgw9ovl8Za+hfXZMdBjVHcb8pbGgBDZ12EGSHK3i GThHbEaEwKJQM0dWtK+W/jJrURxdB6/gGBQi18rXzVH9XT65+MBc++D/WekSoFxD2Iz+ oSP5nmbjRrBw3Z0Rlp3l8VtDjpKxcH6CZQkKJl0bu2EHuXXZgmri8JBzyuXUWPxwYYWy PTBP4O5BEKHDj2/IVo9RC4XqyASZmzag1OVv4A2cScQGpU4nlmvqUZa3M5p0xNe+6MyA iftxMIYBEtxBbu32+HaXKrJi4p4bvDrHvqYBr7VHqHHpVUzEaGzCv7CnzFRC1WYmIOe9 iubg== 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=Qu5Zt8X8iPEVm+2k6E1uL1SP8nJBElBtf5+M08jzYow=; b=d/GhVIcxGH6nZ015GSJ+7/1QqWtI1L6TyCcBxD9ScdwdwB2g1vO5PmefJBQzZiEldO icLDRGmO/eLOfLVeXQiLcwxnjq/hlKOGi6cf1OzFhtzI2iGXX8HJXP/RArwrDaF5IDO4 EC37H1hIX64NbqktDXZ9HqHxhp38HFkkOvOpTJ64cAgqzDfqnflLLxvpB7pleH8jy0HZ eCqW9ZHyWprSvDLzmnivodfHeXkquL1JF0YYLEQmXSAIAlM627Xt0f6m2g6fpcsfnj9w VuPv5WiyPWoVbfgZS5k8ReYEz4a0MRisKH/gaOS63a8IsYdxvS95PnpKXqeCQArdrpry Ttcg== 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 a2si5935370pgd.461.2018.12.15.01.07.06; Sat, 15 Dec 2018 01:07:25 -0800 (PST) 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 S1730060AbeLOJEu (ORCPT + 99 others); Sat, 15 Dec 2018 04:04:50 -0500 Received: from jablonecka.jablonka.cz ([91.219.244.36]:36997 "EHLO jablonecka.jablonka.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729465AbeLOJEu (ORCPT ); Sat, 15 Dec 2018 04:04:50 -0500 X-Greylist: delayed 577 seconds by postgrey-1.27 at vger.kernel.org; Sat, 15 Dec 2018 04:04:49 EST Received: from twilight.vojtech.kobylisy.czf (unknown [10.32.148.9]) by jablonecka.jablonka.cz (Postfix mail delivery) with ESMTP id E77D8603494B; Sat, 15 Dec 2018 09:55:10 +0100 (CET) Received: by twilight.vojtech.kobylisy.czf (Postfix, from userid 1000) id D1F471549A6A; Sat, 15 Dec 2018 09:55:10 +0100 (CET) Date: Sat, 15 Dec 2018 09:55:10 +0100 From: Vojtech Pavlik To: Pavel Machek Cc: kernel list , jikos@suse.cz, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com Subject: Re: [rfd] saving old mice -- button glitching/debouncing Message-ID: <20181215085510.GB12930@suse.com> References: <20181214232437.GA8310@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181214232437.GA8310@amd> X-Bounce-Cookie: It's a lemon tree, dear Watson! 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 On Sat, Dec 15, 2018 at 12:24:37AM +0100, Pavel Machek wrote: > Patch is obviously not ready; but: > > a) would it be useful to people Probably not. Mice already do internal software/hardware debouncing on switches. If you see duplicate clicks making it all the way to the kernel driver, something is very wrong with the switch, to the point where it'll soon fail completely. Hence the value of doing extra processing in the kernel is very limited. > b) would it be acceptable if done properly? (cmd line option to > enable, avoiding duplicate/wrong events?) Well, for one, you shouldn't be using a timer, all the debouncing can be done by math on the event timestamps. You'd also have a hard time distinguishing between doubleclicks and bounces. Since the mice already filter the quick bounces and there is significant delay (100ms on USB, similar on PS/2) between updates from the hardware, a real doubleclick can look absolutely the same as what you observe as a bounce. As such, it couldn't be enabled by default. If you really want to go this way, a userspace solution is the better choice. -- Vojtech Pavlik