Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: "Csókás Bence" <csokas.bence@prolan.hu>
To: Frank Li <Frank.li@nxp.com>
Cc: <imx@lists.linux.dev>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, Wei Fang <wei.fang@nxp.com>,
	Shenwei Wang <shenwei.wang@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Richard Cochran <richardcochran@gmail.com>
Subject: Re: [PATCH 2/2] net: fec: Reload PTP registers after link-state change
Date: Tue, 17 Sep 2024 09:53:07 +0200	[thread overview]
Message-ID: <c70a049b-cef8-4b9d-8fd6-e9d8ec0270cc@prolan.hu> (raw)
In-Reply-To: <ZuhJJ5BEgu9q6vaj@lizhi-Precision-Tower-5810>

Hi!

On 9/16/24 17:05, Frank Li wrote:
> On Mon, Sep 16, 2024 at 04:19:31PM +0200, Csókás, Bence wrote:
>> On link-state change, the controller gets reset,
>> which clears all PTP registers, including PHC time,
>> calibrated clock correction values etc. For correct
>> IEEE 1588 operation we need to restore these after
>> the reset.
> 
> I am not sure if it necessary. timer will be big offset after reset. ptpd
> should set_time then do clock frequency adjust, supposed just few ms, ptp
> time will get resync.
> 
> of course, restore these value may reduce the resync time.
> 
> Frank

There's 3 problems with that:
1. ATCORR, ATINC and ATPER will not be restored, therefore precision 
will be immediately lost.
2. ptpd does NOT set the time, only once, on startup. Currently, on 
link-down, ptpd tries to correct for the missing 54 years by making the 
PHC tick 3% faster (therefore the PPS signal will have a frequency error 
as well), which will never get it there. One work-around is to 
periodically re-start ptpd, but this is obviously sub-optimal.
3. If the PTP server goes away, there's no way to restore the time. 
Whereas if you save and reload it, you can continue, although with 
degraded precision.

Bence


  reply	other threads:[~2024-09-17  7:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-16 14:19 [PATCH 1/2] net: fec: Restart PPS after link state change Csókás, Bence
2024-09-16 14:19 ` [PATCH 2/2] net: fec: Reload PTP registers after link-state change Csókás, Bence
2024-09-16 15:05   ` Frank Li
2024-09-17  7:53     ` Csókás Bence [this message]
2024-09-17 15:23       ` Frank Li
2024-09-19  8:18 ` [PATCH 1/2] net: fec: Restart PPS after link state change Paolo Abeni

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=c70a049b-cef8-4b9d-8fd6-e9d8ec0270cc@prolan.hu \
    --to=csokas.bence@prolan.hu \
    --cc=Frank.li@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=imx@lists.linux.dev \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=richardcochran@gmail.com \
    --cc=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.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