All of lore.kernel.org
 help / color / mirror / Atom feed
From: Flugsvamp <jlemon@flugsvamp.com>
To: Richard Cochran <richardcochran@gmail.com>
Cc: Jonathan Lemon <jonathan.lemon@gmail.com>,
	netdev@vger.kernel.org, f.fainelli@gmail.com, andrew@lunn.ch,
	hkallweit1@gmail.com, linux@armlinux.org.uk,
	bcm-kernel-feedback-list@broadcom.com, kernel-team@fb.com,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	edumazet@google.com
Subject: Re: [PATCH net-next v5 2/2] net: phy: broadcom: Add PTP support for some Broadcom PHYs.
Date: Mon, 30 May 2022 18:15:44 -0700	[thread overview]
Message-ID: <57926B53-BB8B-4A9B-9340-0DFFDA4452BA@flugsvamp.com> (raw)
In-Reply-To: <20220530230439.GA22405@hoboy.vegasvil.org>



> On May 30, 2022, at 4:04 PM, Richard Cochran <richardcochran@gmail.com> wrote:
> 
> On Mon, May 30, 2022 at 10:07:44AM -0700, Jonathan Lemon wrote:
>>> On Sat, May 28, 2022 at 05:34:47PM -0700, Richard Cochran wrote:
>>>> On Wed, May 18, 2022 at 03:39:35PM -0700, Jonathan Lemon wrote:
>>> 
>>>> +static int bcm_ptp_adjtime_locked(struct bcm_ptp_private *priv,
>>>> +                  s64 delta_ns)
>>>> +{
>>>> +    struct timespec64 ts;
>>>> +    int err;
>>>> +
>>>> +    err = bcm_ptp_gettime_locked(priv, &ts, NULL);
>>>> +    if (!err) {
>>>> +        set_normalized_timespec64(&ts, ts.tv_sec,
>>>> +                      ts.tv_nsec + delta_ns);
>>> 
>>> This also takes a LONG time when delta is large...
>> 
>> Didn't we just go through this?  What constitutes a "large" offset here?
>> The current version seems acceptable to me:
> 
> When the PHY boots, it starts from time zero.
> 
> Then as a client it needs to adjust to today, something like:
> 
> 1653951762.413809006 or Mon May 30 16:02:42 2022
> 
> (that means adding 1,653,951,762,413,809,006 nanoseconds)
> 
> Try that and see how long it takes to apply the adjustment.

That’s certainly a big adjustment. I was expecting something along the lines of a settime() call, followed up by adjtime().

Will fix. Seems like there should be a better call sequence for this, though. 

Sent from my iPhone

  reply	other threads:[~2022-05-31  1:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18 22:39 [PATCH net-next v5 0/2] Broadcom PTP PHY support Jonathan Lemon
2022-05-18 22:39 ` [PATCH net-next v5 1/2] net: phy: broadcom: Add Broadcom PTP hooks to bcm-phy-lib Jonathan Lemon
2022-05-18 22:39 ` [PATCH net-next v5 2/2] net: phy: broadcom: Add PTP support for some Broadcom PHYs Jonathan Lemon
2022-05-20 17:24   ` Florian Fainelli
2022-05-21  2:04     ` Jonathan Lemon
2022-05-23  2:49       ` Florian Fainelli
2022-05-30 22:18         ` Jonathan Lemon
2022-05-29  0:34   ` Richard Cochran
2022-05-30 17:07     ` Jonathan Lemon
2022-05-30 23:04       ` Richard Cochran
2022-05-31  1:15         ` Flugsvamp [this message]
2022-05-28  3:27 ` [PATCH net-next v5 0/2] Broadcom PTP PHY support Richard Cochran
2022-05-30 16:48   ` Jonathan Lemon

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=57926B53-BB8B-4A9B-9340-0DFFDA4452BA@flugsvamp.com \
    --to=jlemon@flugsvamp.com \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=jonathan.lemon@gmail.com \
    --cc=kernel-team@fb.com \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --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.