Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp359138pxk; Thu, 3 Sep 2020 01:17:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+8ncH8C2kqYEMqoSbErpeh4t6Ib2xHmHyV2Iubr8hsrXyn4pqS54NmK0OEaTkjn3BBrjk X-Received: by 2002:a17:906:1757:: with SMTP id d23mr926019eje.126.1599121067427; Thu, 03 Sep 2020 01:17:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599121067; cv=none; d=google.com; s=arc-20160816; b=XtU41Ri1pbTs4YieWh/298pfjdkkyQbXft7RI7EKG5ijVkV4udQzuAXIu6ueJ/yf/o a13BGwWsfZtjYFs11WzqVcx2GKB0HQd0sWpbR5SO1P6RA6irrS98Ki4e3rhtZNwpP8DZ nv6BQ8y0e+Qnp7JzcB0xH+x01nt4mQtNFOFYaJEDa5OsHTyU+hjXI6mP9c4NqeKfZGxd Agnw/nmDVIq5CNiayY3rsjvYSt5IDJRd6m7s4dmdbu4ikemv9WkC68RjpdNl8HPjuje+ TN7lLCk0g9U2ExIPcuw3A2IFUsAWoJNoNT45mtHw011AZh4P07RXcFK6pHUh0iYvvFh4 0iYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zUoJbHPHuQXdey7P9WwyU7u5m+V2GxPJvOAbd/pjt6Y=; b=SiviTG6b6rTgZsTLbwQvuWfELKr+YwC5/DP9xKc0elYXDaAApEtUN5YmXo/f1zGlj4 S7hmaubSTL2N5aJvrXiA3K1J9aM2gDPkOcI62fefESpNOp5RkMMYDj//lozWk8agSK1P U49u0vmrQuiSVpR0aKgdOivtGsGrLX7qgyY7oaZCESrIZRJXrh6rQL1jJkgb9y3MFpTX p5WE2oL9sYJ7lzoqoIHQJqQh0ZNWh3mCmXpny0ebWHFrnqdyoxtVA+cAYplfoorUcSrT RDpncHTuKjX0YZnKGuxlJXCsb6fZK9NO58MnYyQOdWw1JD9mGlqhgNxb9iRUOBgkmONw DsXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Vls6af3n; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si1389658eji.298.2020.09.03.01.17.23; Thu, 03 Sep 2020 01:17:47 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=Vls6af3n; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728330AbgICIOQ (ORCPT + 99 others); Thu, 3 Sep 2020 04:14:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728754AbgICINz (ORCPT ); Thu, 3 Sep 2020 04:13:55 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40A7AC061244 for ; Thu, 3 Sep 2020 01:13:55 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id b12so1711296edz.11 for ; Thu, 03 Sep 2020 01:13:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zUoJbHPHuQXdey7P9WwyU7u5m+V2GxPJvOAbd/pjt6Y=; b=Vls6af3nzQFKgGvvhF/oX43ytcRIy1cL6cfsmdlTLy0V8u8caSqNL++pef1UL8SLTF 5BxoR5ULjKWh6HL2xQnr2jtLmgtpeZiHDuduqNsZoV2iMe+yDhV+4PkKFQbvCwIcSAZa DImsPiza7nA2m0ZOimu8TLhBWVpTCRmU387kDxlJ2sepaG1nw1maxek1mJ5ZgmX0aOZd x0ZzT9cRNwXpVUn1DsiwyYYLw9CgCY/3wkRl3ssYVbTfHvgeLAceCcJLY81rQfl6TqXc 5+WrVs8ZBBWCYp/hj9ChaU0n/7NbZI/kl4zcJoMWt+CMmCtoJx9fOK5QYgluWl/V2Efe PsHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zUoJbHPHuQXdey7P9WwyU7u5m+V2GxPJvOAbd/pjt6Y=; b=nW6AYbWwSav5VvLxHYqj5ZC7ht5KvEMl/QzveQkhPn9EICwY+rbbo7XZWJEfVWklvN aOkJ2iKriH9H5wc7hBk3hR7HVwA6ArMFAc0lhM89dG0CBV3eft5PEJeALhhVraci1AWf BsHKD5/ptYeJlEUZLyxefB+5f/lJ4nwBMi7X+Ko2Hb6eLlR8bJFOLU9eFTKBr5n65lIe grL1jIKd2Qn20QE/T6Uf7MZFf/GX7vnezrBbmTHbmWJeF3kLNIg0dzx76VNPiRHXX7Eh +/G0kVAgyW/h9BXkKItiUwOjsHnORm9SQa1HHfY9ylqSHjq+x11qRBSUNK3PAWDeDq0d 38sA== X-Gm-Message-State: AOAM530eENbk49b0OP5E58zb/dAtvbGZCxlUnXFwywKPrJCCSX1AUwqx gFpAtiqTsf+09jRmyktSvUy51RSWt52eMzY28KavXe/ry8E= X-Received: by 2002:a50:f687:: with SMTP id d7mr1882489edn.353.1599120833752; Thu, 03 Sep 2020 01:13:53 -0700 (PDT) MIME-Version: 1.0 References: <20200831032006.1019978-1-warthog618@gmail.com> <20200831032006.1019978-10-warthog618@gmail.com> <20200903080909.GA17108@sol> In-Reply-To: <20200903080909.GA17108@sol> From: Bartosz Golaszewski Date: Thu, 3 Sep 2020 10:13:43 +0200 Message-ID: Subject: Re: [PATCH v6 09/20] gpiolib: cdev: support edge detection for uAPI v2 To: Kent Gibson Cc: LKML , linux-gpio , Linus Walleij Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 3, 2020 at 10:09 AM Kent Gibson wrote: > > 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. I should have RTFC I guess. :) Bart