lkml.org 
[lkml]   [2020]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v6 09/20] gpiolib: cdev: support edge detection for uAPI v2
On Thu, Sep 3, 2020 at 10:09 AM Kent Gibson <warthog618@gmail.com> 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 <warthog618@gmail.com> 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

\
 
 \ /
  Last update: 2020-09-03 10:15    [W:0.059 / U:6.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site