All of lore.kernel.org
 help / color / mirror / Atom feed
From: "François Legal" <devel@thom.fr.eu.org>
To: "Chen, Hongzhan" <hongzhan.chen@intel.com>
Cc: "xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: RE: Large gpio interrupt latency
Date: Wed, 16 Jun 2021 11:12:36 +0200	[thread overview]
Message-ID: <1202-60c9c080-151-1ab27320@266229055> (raw)
In-Reply-To: <BN9PR11MB5227F2779A44C6154AE060D7F20F9@BN9PR11MB5227.namprd11.prod.outlook.com>

Le Mercredi, Juin 16, 2021 11:05 CEST, "Chen, Hongzhan" <hongzhan.chen@intel.com> a écrit:

>
>
> >-----Original Message-----
> >From: François Legal <devel@thom.fr.eu.org>
> >Sent: Wednesday, June 16, 2021 4:19 PM
> >To: Chen, Hongzhan <hongzhan.chen@intel.com>
> >Cc: xenomai@xenomai.org
> >Subject: RE: Large gpio interrupt latency
> >
> >Le Mercredi, Juin 16, 2021 10:10 CEST, "Chen, Hongzhan" <hongzhan.chen@intel.com> a écrit:
> >
> >>
> >> >
> >> >-----Original Message-----
> >> >From: Xenomai <xenomai-bounces@xenomai.org> On Behalf Of François Legal via Xenomai
> >> >Sent: Wednesday, June 16, 2021 3:16 PM
> >> >To: xenomai@xenomai.org
> >> >Subject: Large gpio interrupt latency
> >> >
> >> >Hello,
> >> >
> >> >working on a realtime data recorder (for which I submitted a patch to add timestamp retrieval for net packets), I experience a strange latency problem with taking GPIO interrupts.
> >> >
> >> >So basically my app monitors network packets (which as received by the DUT would trigger toggling of a GPIO on the DUT) and one GPIO.
> >> >We know (from some ohter reference instrument) that the DUT would toggle the GPIO 1-2ms after receiving a specific network packet.
> >> >
> >> >My recorder app relies on the timestamping of events done in interrupts service routines for GPIOs and network interface. By checking the timestamps returned by the application, I get an about 50ms delay between the network packet and the GPIO (so something between 51 and 52ms delay).
> >> >
> >>
> >> Are you toggling gpio and access gpio device  through your rtdm device like on path /dev/rtdm/your_gpiocontroller/gpio*?
> >>
> >
> >Maybe my setup was not very clear.
> >I've got a DUT that receives network data, and toggles one of its GPIOs depending one the network data.
> >
> >I've got another device running my realtime recording app, that receives the same network data as the DUT, and that has one of its GPIO connected to the DUT GPIO.
> >
> >On the recording app, I use the RTDM device to open, ioctl (enable interrupt + timestamp), then select & read the GPIO value.
>
> When issue happen, the recording app side have got same number of network data packages and gpio interrupts with that DUT have been toggling?
> I am asking this because I met gpio hardware issue that would cause gpio interrupt missing or invalid gpio interrupts when gpio is connecting on two different boards.
>

AFAICT, I'm not missing GPIO edges/interrupts in the app. Regarding network, the DUT and the recoding device are connected to the same switch with the same port config.

Moreover, I tried changing the interrupt polarity of the recording device (switched from rising edge to falling edge), and the result is 1-2ms + ~30ms (the width of the pulse of the DUT) + 50ms latency

> >
> >François
> >
> >
> >> Hongzhan Chen
> >>
> >> >I wonder where that might be coming from.
> >> >
> >> >Any idea ?
> >> >
> >> >thanks in advance
> >> >
> >> >François
> >
> >
> >



  reply	other threads:[~2021-06-16  9:12 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  7:15 Large gpio interrupt latency François Legal
2021-06-16  8:10 ` Chen, Hongzhan
2021-06-16  8:18   ` François Legal
2021-06-16  9:05     ` Chen, Hongzhan
2021-06-16  9:12       ` François Legal [this message]
2021-06-16  9:40         ` Jan Kiszka
2021-06-16 13:29           ` François Legal
2021-06-16 13:38             ` Jan Kiszka
2021-06-16 13:51               ` François Legal
2021-06-16 15:10                 ` Jan Kiszka
2021-06-17  7:15                   ` François Legal
2021-06-18 18:41                   ` François Legal
2021-06-21  6:56                     ` Jan Kiszka
2021-06-21  9:39                       ` Philippe Gerum
2021-06-21 13:38                         ` Jan Kiszka
2021-06-21 13:54                           ` Philippe Gerum
2021-06-21 14:02                             ` Jan Kiszka
2021-06-21 14:28                               ` Philippe Gerum
2021-06-21 14:46                                 ` Jan Kiszka
2021-06-21 14:57                                   ` Philippe Gerum
2021-06-21 15:35                                     ` François Legal
2021-06-21 16:38                                       ` Philippe Gerum
2021-06-21 16:45                                         ` Philippe Gerum
2021-06-21 18:06                                           ` François Legal
2021-06-22  7:38                                             ` Philippe Gerum
2021-06-22  7:49                                               ` Julien Blanc
2021-06-22  8:22                                                 ` Jan Kiszka
2021-06-22  8:37                                                   ` Philippe Gerum
2021-06-22  9:14                                                     ` Jan Kiszka
2021-06-22  9:31                                                       ` Philippe Gerum
2021-06-22  9:39                                                         ` Jan Kiszka
2021-06-22 10:07                                                           ` Philippe Gerum
2021-07-23  7:02                                                             ` François Legal
2021-07-23  8:04                                                               ` Philippe Gerum
2021-08-02 12:24                                                                 ` Jan Kiszka
2021-08-05 15:11                                                                   ` François Legal

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=1202-60c9c080-151-1ab27320@266229055 \
    --to=devel@thom.fr.eu.org \
    --cc=hongzhan.chen@intel.com \
    --cc=xenomai@xenomai.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.