Re: [PATCH v6 09/20] gpiolib: cdev: support edge detection for uAPI v2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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.



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux