From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [RFC] libgpiod public API reviews needed Date: Sun, 21 Jan 2018 23:18:59 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from mail-oi0-f67.google.com ([209.85.218.67]:41444 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbeAUWTB (ORCPT ); Sun, 21 Jan 2018 17:19:01 -0500 Received: by mail-oi0-f67.google.com with SMTP id m83so2245092oik.8 for ; Sun, 21 Jan 2018 14:19:01 -0800 (PST) In-Reply-To: Sender: linux-gpio-owner@vger.kernel.org List-Id: linux-gpio@vger.kernel.org To: Bartosz Golaszewski Cc: Linus Walleij , linux-gpio@vger.kernel.org, Andy Shevchenko , Clemens Gruber , Thierry Reding , Peter Rosin , Lars-Peter Clausen On Sun, Jan 21, 2018 at 10:30 PM, Bartosz Golaszewski wrote: > 2018-01-21 16:49 GMT+01:00 Linus Walleij : >> On Fri, Jan 19, 2018 at 2:28 PM, Bartosz Golaszewski wrote: > I was not aware of this, but it seems you're right! Nice catch, thanks. > > How about defining a local struct gpiod_timespec with both seconds and > nanoseconds explicitly defined to uint64_t? Where is that timestamp generated? Is this purely a user space interface with the time read from gettimeofday(), or are we talking about a new kernel-to-user interface? In a lot of cases, a simple 64-bit nanosecond counter using CLOCK_MONOTONIC timestamps is the most robust and simple solution. Arnd