Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp127170pxb; Tue, 15 Feb 2022 09:42:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmo6cQUO2qN4hCUbFimbXtJLOoViXiG/PstlSFHwresYyQ4q5DyW8K1GgJNm/BX9+UfVIc X-Received: by 2002:a17:902:d4c1:: with SMTP id o1mr101714plg.170.1644946969915; Tue, 15 Feb 2022 09:42:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644946969; cv=none; d=google.com; s=arc-20160816; b=D2mxgXD8b+rrX4XAah+jpVV/ppV59L+j/oWUV5mtCSOz5iLoYpXwGUJdUHjFCtFF3L 5r5OQvNEr+/Y68eCkW0WAnbcy3eFCHVLpl8LFQ59pAjSguSeSQOCV3OmqQ2Z6aBlsor9 nxho6v3TYstiU6AVfFKI+d5+UqxwpI00crqsnEFABcYtZvwyRm3ZWg0Mrhwfi7C3dRGv ecqLcNChg6AICsrn/kTPYg9XHEUACb/2qhcQv5qEU0ose5lLdlWhydWDhv8Lz9h9VePK T37ZoLuweU91SYcakPxLYeFhZ8FshttpX3HgwLM5E6bcKMHNc53B+BQN2tTG22wdEIlC ckMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=1ZNPe2sPZOkFal02mevnJa8M8tDua9sMBQg5TIqy7IY=; b=mpuGNK1JRvOaHnGpp3x/3hDzLRtV44lv2fKll+xsQWUP4YGw61S0gxKZkFylBda+WA OKoWv2VRDdCGu2qbCfiZK1dG6h3ksjnJxVsnCZtC4zCh5s7Jnaa/k50Z5DfTL29SF5Y3 erusYGDgXfDq6Gl1sTe9B+auDsz/K88KJBvHJVZWZw+P1Prc6vRcQrcO/FpmGnGm5F8e p2tSYRi5MzBRE2L1vbVnByebUepBciZsTmCieeMetLcSshdSJ32L7WmQRGNhs7J6t5iD 2ejM7XVMTWw57qHaBACeCs+HOV8Voxs+aH0H4Uly7kS+OvwpqYF6TNxcd2zRys3wR8au OYaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mi14si18211621pjb.47.2022.02.15.09.42.32; Tue, 15 Feb 2022 09:42:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233880AbiBOQCd (ORCPT + 99 others); Tue, 15 Feb 2022 11:02:33 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237847AbiBOQCb (ORCPT ); Tue, 15 Feb 2022 11:02:31 -0500 Received: from hs01.dk-develop.de (hs01.dk-develop.de [173.249.23.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14F0BB88; Tue, 15 Feb 2022 08:02:19 -0800 (PST) From: Danilo Krummrich To: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: linus.walleij@linaro.org Subject: ps2-gpio: use ktime for IRQ timekeeping Date: Tue, 15 Feb 2022 17:02:04 +0100 Message-Id: <20220215160208.34826-1-danilokrummrich@dk-develop.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since v1 ================ - add patch to refactor struct ps2_gpio_data for clear separation between RX and TX - make all variables for IRQ timekeeping per-port and initialize them in ps2_gpio_open() This patch series implements the usage of ktime for IRQ timekeeping to overcome: (1) The resolution limitations of jiffies. (2) Potential spurious IRQs generated by gpio controllers. Besides that, based on the newly implemented timekeeping, it fixes a wrongly suspected extra clock cycle for TX transfers and a race condition when starting an immediate TX transfer based on data received from an RX transfer. Danilo Krummrich (4): input: ps2-gpio: refactor struct ps2_gpio_data input: ps2-gpio: use ktime for IRQ timekeeping input: ps2-gpio: remove tx timeout from ps2_gpio_irq_tx() input: ps2-gpio: don't send rx data before the stop bit drivers/input/serio/ps2-gpio.c | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------ 1 file changed, 116 insertions(+), 64 deletions(-)