lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VcAf8i=jEdDFntpDfLBDMWoJh+ykHBTBRX53B9L+yFNUA@mail.gmail.com>
Date:   Fri, 16 Oct 2020 17:13:22 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     Kent Gibson <warthog618@...il.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>,
        Linus Walleij <linus.walleij@...aro.org>,
        Jack Winch <sunt.un.morcov@...il.com>
Subject: Re: [PATCH v2 1/3] gpiolib: cdev: allow edge event timestamps to be
 configured as REALTIME

On Thu, Oct 15, 2020 at 6:53 AM Kent Gibson <warthog618@...il.com> wrote:
>
> Using CLOCK_REALTIME as the source for event timestamps is crucial for
> some specific applications, particularly those requiring timetamps
> relative to a PTP clock, so provide an option to switch the event
> timestamp source from the default CLOCK_MONOTONIC to CLOCK_REALTIME.
>
> Note that CLOCK_REALTIME was the default source clock for GPIO until
> Linux 5.7 when it was changed to CLOCK_MONOTONIC due to issues with the
> shifting of the realtime clock.
> Providing this option maintains the CLOCK_MONOTONIC as the default,
> while also providing a path forward for those dependent on the pre-5.7
> behaviour.

...

>          GPIO_V2_LINE_DIRECTION_FLAGS | \
>          GPIO_V2_LINE_DRIVE_FLAGS | \
>          GPIO_V2_LINE_EDGE_FLAGS | \
> +        GPIO_V2_LINE_FLAG_EVENT_CLOCK_REALTIME | \

Wondering if we would have something like

          GPIO_V2_LINE_CLOCK_FLAGS | \

here for the sake of consistency.

>          GPIO_V2_LINE_BIAS_FLAGS)

...

> +static u64 line_event_timestamp(struct line *line)
> +{

> +       if (test_bit(FLAG_EVENT_CLOCK_REALTIME, &line->desc->flags))

I dunno if we can actually drop the word EVENT from these definitions.
I don't think we would have in the near future something similar for
the non-event data.

> +               return ktime_get_real_ns();
> +
> +       return ktime_get_ns();
> +}

In general it looks good, thanks!

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ