linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dipen Patel <dipenp@nvidia.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Kent Gibson <warthog618@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"thierry.reding@gmail.com" <thierry.reding@gmail.com>,
	Jon Hunter <jonathanh@nvidia.com>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	linux-tegra <linux-tegra@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Arnd Bergmann <arnd@arndb.de>,
	"Richard Cochran" <richardcochran@gmail.com>
Subject: Re: GTE - The hardware timestamping engine
Date: Tue, 23 Mar 2021 11:01:57 -0700	[thread overview]
Message-ID: <378e2d1b-9b38-605b-c20f-fbfeefb07c6d@nvidia.com> (raw)
In-Reply-To: <CACRpkdbkmwuAJzD-CpWKqmL3_n1xkvv_2M_DsNs+ZquiaRkKgA@mail.gmail.com>



On 3/23/21 2:08 AM, Linus Walleij wrote:
> On Mon, Mar 22, 2021 at 9:17 PM Dipen Patel <dipenp@nvidia.com> wrote:
> 
>> My follow-up concerns on both Linus's and Kent's feedback:
>>
>> 1.  Please correct me if I am wrong, lineevent in the gpiolib* is only
>>     serves the userspace clients.
>> 1.a What about kernel drivers wanting to use this feature for monitoring its
>>     GPIO lines, see gyroscope example somewhere below. In that regards,
>>     lineevent implementation is not sufficient.
>> 1.b Are you also implying to extend lineevent implementation to kernel
>>     drivers?
> 
> I was talking about lineevent because you mentioned things like
> motors and robotics, and those things are traditionally not run in
> kernelspace because they are not generic hardware that fit in the
> kernel subsystems.
> 
> Normally industrial automatic control tasks are run in a userspace
> thread with some realtime priority.
> 
I mentioned those two use cases as illustration purpose as GTE is not just
restricted to robotics and vehicles. I agree that those applications run
mostly from userspace with RT priority but there most certainly some
kernel drivers they interact and it may want to use GTE, for example,
BMI088 devices mostly used in drones and robotics, it could be extended to
use GTE for its GPIO hw timestamping, GPIO is used to indicate data ready.

> As Kent says, in-kernel events are exclusively using IRQ as
> mechanism, and should be modeled as IRQs. Then the question
> is how you join the timestamp with the IRQ. GPIO chips are
> just some kind of irqchip in this regard, we reuse the irqchip
> infrastructure in the kernel for all GPIO drivers that generate
> "events" in response to state transitions on digital lines.
> 
>>>> And certainly you will also want to use this timestamp for
>>>> IIO devices? If it is just GPIOs and IRQs today, it will be
>>>> gyroscopes and accelerometers tomorrow, am I right?
>>>>
>>
>> Gyroscope, accelerometers or any IIO are built on top of i2c/spi and/or GPIOs.
>> So they are covered as long as they serve as client to GTE framework, For
>> example, if gyroscope uses GPIO as an interrupt to indicate frame
>> ready, GTE could timestamp that GPIO as well any IRQs like i2c transaction
>> complete IRQ. To this to happen, gycroscope then register itself with
>> GTE framework and enable required signals that it interfaces/interested with.
> 
> I think there are IIO devices that provide their own
> hardware timestamp and as such they might want to use that,
> so the mechanism need to be generic enough that a certain
> hardware timestamp can be selected sooner or later.
> But let's not overcomplicate things for now.
> 

I agree, above BMI088 has its own timestamping engine. I have to look into
that aspect for bringing its TS engine into GTE framework as one of the possible
off-chip provides besides in-chip GTEs. We can defer that part for later. Thanks
for pointing that out.

> Yours,
> Linus Walleij
> 

      parent reply	other threads:[~2021-03-23 17:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 22:33 GTE - The hardware timestamping engine Dipen Patel
2021-03-20 11:56 ` Linus Walleij
2021-03-20 12:44   ` Arnd Bergmann
2021-03-20 15:38     ` Richard Cochran
2021-03-22 20:33       ` Dipen Patel
2021-03-23  9:03         ` Thierry Reding
2021-03-23 12:51           ` Richard Cochran
2021-03-22  6:00   ` Kent Gibson
2021-03-22 20:21     ` Dipen Patel
2021-03-23  0:32       ` Kent Gibson
2021-03-23  1:53         ` Dipen Patel
2021-03-23  2:59           ` Kent Gibson
2021-03-23  4:09             ` Dipen Patel
2021-03-23  5:22               ` Kent Gibson
2021-03-23  9:08       ` Linus Walleij
2021-03-23 10:06         ` Thierry Reding
2021-03-23 18:21           ` Marc Zyngier
2021-03-23 18:25           ` Dipen Patel
2021-03-23 21:19           ` Dipen Patel
2021-03-23 18:01         ` Dipen Patel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=378e2d1b-9b38-605b-c20f-fbfeefb07c6d@nvidia.com \
    --to=dipenp@nvidia.com \
    --cc=arnd@arndb.de \
    --cc=bgolaszewski@baylibre.com \
    --cc=jonathanh@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=warthog618@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).