All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Lemon <jonathan.lemon@gmail.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: netdev@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH] ptp: Add PTP_CLOCK_EXTTSUSR internal ptp_event
Date: Mon, 28 Jun 2021 17:19:28 -0700	[thread overview]
Message-ID: <20210629001928.yhiql2dngstkpadb@bsd-mbp.dhcp.thefacebook.com> (raw)
In-Reply-To: <20210628233056.GA766@hoboy.vegasvil.org>

On Mon, Jun 28, 2021 at 04:30:56PM -0700, Richard Cochran wrote:
> On Mon, Jun 28, 2021 at 11:46:11AM -0700, Jonathan Lemon wrote:
> > This event differs from CLOCK_EXTTS in two ways:
> > 
> >  1) The caller provides the sec/nsec fields directly, instead of
> >     needing to convert them from the timestamp field.
> 
> And that is useful?  how?

The devices I have provide the sec/nsec values directly from the
FPGA/hardware.  (IIRC, there is another in-tree driver that does
the same thing).  Right now, these values must be coerced into a
timestap, and then re-converted back to a sec/nsec value, which
seems a bit pointless.

> >  2) A 32 bit data field is attached to the event, which is returned
> >     to userspace, which allows returning timestamped data information.
> >     This may be used for things like returning the phase difference
> >     between two time sources.
> 
> What two time sources?
> 
> What problem are you trying to solve?
> 
> As it stands, without any kind of rational at all, this patch gets a NAK.

I have two use cases:

1) The external PPS source from the FPGA returns a counter
   corresponding to the pulse events which is used to insure
   a pulse isn't lost.   This is a marginal case, since the 
   counter can be reverse engineered from the timestamp.

2) The OpenCompute timecard has an on-board rubidium atomic
   clock, and also a GPS receiver.  The atomic clock needs 
   to be steered slightly to keep thse in phase.

   The PPS from the clock and GPS are measured and the 
   phase difference/error is reported every second.  This
   difference is then used to steer the clock, so it can 
   reliably take over in case of GPS loss.

   So, I need a PPS (with timestamp), along with the phase
   difference (data).

This fits in nicely with the extts event model.  I really
don't want to have to re-invent another ptp_chardev device
that does the same thing - nor recreate a extended PTP.
-- 
Jonathan

  reply	other threads:[~2021-06-29  0:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28 18:46 [PATCH] ptp: Add PTP_CLOCK_EXTTSUSR internal ptp_event Jonathan Lemon
2021-06-28 23:30 ` Richard Cochran
2021-06-29  0:19   ` Jonathan Lemon [this message]
2021-06-30  0:09     ` Richard Cochran
2021-06-30  3:50       ` Jonathan Lemon
2021-06-30 14:42         ` Richard Cochran
2021-06-30 15:55           ` Machnikowski, Maciej
2021-06-30 22:16             ` Jonathan Lemon
2021-06-30 22:57           ` Jonathan Lemon
2021-07-01 14:59         ` Richard Cochran
2021-07-01 16:15           ` Jonathan Lemon
2021-07-01 17:07             ` Richard Cochran

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=20210629001928.yhiql2dngstkpadb@bsd-mbp.dhcp.thefacebook.com \
    --to=jonathan.lemon@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@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 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.