Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp358345pxk; Thu, 3 Sep 2020 01:15:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbpf0hFMoWXactkuIJXl2cKTQMDtA/lFBFWi5Etf3rSY7ssrFN7pMOEcCs9qfUVtBcP86e X-Received: by 2002:a17:906:68cd:: with SMTP id y13mr958128ejr.132.1599120957343; Thu, 03 Sep 2020 01:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599120957; cv=none; d=google.com; s=arc-20160816; b=kiOv4qkXIln0QZfSpKm6WW1p+K3eqor9WjTa3d24Fh/VjrbhvI6WhIEtf/id82SDpV DOlsNI6HYlaQD6hyQRMo6v0+OW8k2vWMzqnaoZ0jDgr8qzlxpZz7PKwBFRk/7YoHcX4l qFvFqUaxUvKhO+PwdA2Kxa7SX3PUum5OXxEwz2fJlnLY3dIRlyjB3OFbblyXX7moN3is HukIw/07vL9lVA67GY+RsrP6CseLKM9szvdz1D7qQI8dP+JdpiYweqOS9TDTRfO44ByH zjFGLsJPN71C3dVRFe5HcjwU4OH4i5KagkmgrTx3ILXlA22LLCkbXd/EakdK7F2ZuKvI 1ZPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=RURXhoSNO6UVA5+14oGQ42BXO9M7ZTHBpyDbq8ci7Tg=; b=1IDK3SVN2bS9itNDxrhpn08Zh31F9XSHdN9l0/ywAgAhnRQLk7bUDvIE2fM5/w3PA/ 9FchI7Lhyv/huhXdw68jA+6FX5SI0c5lfxnWb7YxCGNMWWqYpo46K07a2b4Qh5073e19 GqVxLXmsYfYStcv7YGT2+eeJhXK+5ZefAMcGrp9E4RrF8cngBCqs0pAgeP+ur5CXOWZI 8iOJd0U8fEXNFUCazI4EwSSuolqh5P+msBolSqZhEgekZkJNEPUAESwc2HEFMXCqyhuI QU7mQ8qI5YsFVRnRT2sPNcp7ockJpODhP78nMdqdxK0hH4aLy4cmTkLKZRHohc/3ScIe 2wNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=R1eQSNdV; 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 e7si1674553ejm.580.2020.09.03.01.15.33; Thu, 03 Sep 2020 01:15:57 -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=R1eQSNdV; 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 S1728870AbgICIKc (ORCPT + 99 others); Thu, 3 Sep 2020 04:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728422AbgICIJS (ORCPT ); Thu, 3 Sep 2020 04:09:18 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE47FC061244; Thu, 3 Sep 2020 01:09:16 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id 2so1130781pjx.5; Thu, 03 Sep 2020 01:09:16 -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=RURXhoSNO6UVA5+14oGQ42BXO9M7ZTHBpyDbq8ci7Tg=; b=R1eQSNdV+yfRPHbTWeXz/dsE6R/9h6TUKo2Z03c0RW6y6977qwabfy86+Nh3D9hUlL kf1Rvy/bzV2Y2ALXtVxHKDaFWw84VmflJ1F+212osnpMZnbFijnvuRUFVaJn0E/mKpne I/n9iVHXiCeOArxYDCeHxWnkhaJfbmNGAwiTM/w0I4ZKXmeCqKjX52/HPrOfj4vpSWPr JWYWbmKdggCKRXbfhOXUoQmpaWU9T+45cpKLCXa8CPQWrnJk/Z+SjlxN3NcjPQd+6jWY 1uSfuDjQUJ+L+5PKGEs2XlARLQ25x2s5dYCRnpTtMipm4Fx4mA+LNryb6j0iMxQ067xD 98Qg== 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=RURXhoSNO6UVA5+14oGQ42BXO9M7ZTHBpyDbq8ci7Tg=; b=TmO7HfthLwwxlo4Nf8Bq1WJbSt427pfGXei8ZBuvYv13TKlzzgD0n0RbZPWAJwupSz 7/58bLkSKUf9zd3LHfL2jVpArnocbtQz5c52M5UIaE0DCE4DIWCGco1dJbFevgFrVWfE QYa+Pgcb0JvttkYpuaYKuViYXbQhaU+OEW27AhmwM6PxnIp/1mr+GPco5wWt60j5oWcD uyMXs2chAKRe4+9Ok2c6ou6o8oZkUv0kptuvvNv9c5crk6S2IfKjGcZ1AhJ/uv47KR6G 6oxZyToHQQbRVw2OghCvEGj1WojopGBQaQT1/JuAg0MlOgEbm6OIPtjBuzuv84rl9F6A 8glQ== X-Gm-Message-State: AOAM530N2Guws2Yz3Vx2HP+FS6BPPnR3O4dAkVyN9VKWQiCyrhd9+oZK b8yqG9vlNVEoQ+Qdi/DooJEXUHEGzk4= X-Received: by 2002:a17:90a:384c:: with SMTP id l12mr2066227pjf.27.1599120555112; Thu, 03 Sep 2020 01:09:15 -0700 (PDT) Received: from sol (106-69-184-100.dyn.iinet.net.au. [106.69.184.100]) by smtp.gmail.com with ESMTPSA id q2sm1799248pgs.90.2020.09.03.01.09.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 01:09:14 -0700 (PDT) Date: Thu, 3 Sep 2020 16:09:09 +0800 From: Kent Gibson To: Bartosz Golaszewski Cc: LKML , linux-gpio , Linus Walleij Subject: Re: [PATCH v6 09/20] gpiolib: cdev: support edge detection for uAPI v2 Message-ID: <20200903080909.GA17108@sol> References: <20200831032006.1019978-1-warthog618@gmail.com> <20200831032006.1019978-10-warthog618@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 03, 2020 at 09:55:22AM +0200, Bartosz Golaszewski wrote: > On Mon, Aug 31, 2020 at 5:22 AM Kent Gibson wrote: > > > > Add support for edge detection to lines requested using > > GPIO_V2_GET_LINE_IOCTL. > > > > The edge_detector implementation is based on the v1 lineevent > > implementation. > > [snip] > > + * close in time as possible to the actual event. > > + */ > > + line->timestamp = ktime_get_ns(); > > + > > + if (lr->num_lines != 1) > > + line->req_seqno = atomic_inc_return(&lr->seqno); > > Do we never increase req_seqno for a single line? > For a single line we just use line_seqno for both to avoid the atomic_inc here and so reduce the time spent in the ISR and any SMP sync overheads. As per the comment in struct linereq: * @seqno: the sequence number for edge events generated on all lines in * this line request. Note that this is not used when @num_lines is 1, as * the line_seqno is then the same and is cheaper to calculate. Cheers, Kent.