mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Cochran <richardcochran@gmail.com>
To: Min Li <min.li.xe@renesas.com>
Cc: Min Li <lnimi@hotmail.com>, "lee@kernel.org" <lee@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next v3 1/2] ptp: introduce PTP_CLOCK_EXTOFF event for the measured external offset
Date: Fri, 15 Dec 2023 06:46:22 -0800	[thread overview]
Message-ID: <ZXxmvsqfMFIF0OWQ@hoboy.vegasvil.org> (raw)
In-Reply-To: <OS3PR01MB65938570774AF540C6BFD8F5BA8CA@OS3PR01MB6593.jpnprd01.prod.outlook.com>

On Thu, Dec 14, 2023 at 09:59:32PM +0000, Min Li wrote:

> Would it be Ok if I use the flags to differentiate extts events from extoff?

That makes sense to me.  We can return the relevant
ptp_extts_request.flags.  Something like:

#define PTP_EXTTS_FLAGS_VALID	PTP_ENABLE_FEATURE

Then you can return

	ptp_extts_event.flags = PTP_EXTTS_FLAGS_VALID | PTP_EXT_OFFSET;

Later on, other drivers can indicate PTP_[RISING|FALLING]_EDGE, if
they can tell which one happened.

>  struct ptp_extts_event {
> -       struct ptp_clock_time t; /* Time event occured. */
> +       union {
> +               struct ptp_clock_time t; /* Time event occurred. */
> +               __s64 offset_ns;         /* Offset event occurred. */

BTW, please don't make a union here.  Instead just add text to the
comment of `struct ptp_clock_time t`.

The `struct ptp_clock_time t` can be a postive or a negative value
(see comment at the top of the file), and so you can put an offset in
there as well.

Thanks,
Richard

      reply	other threads:[~2023-12-15 14:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 16:36 Min Li
2023-12-14 18:38 ` Richard Cochran
2023-12-14 21:59   ` Min Li
2023-12-15 14:46     ` Richard Cochran [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=ZXxmvsqfMFIF0OWQ@hoboy.vegasvil.org \
    --to=richardcochran@gmail.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lnimi@hotmail.com \
    --cc=min.li.xe@renesas.com \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®