nxp-archive / openil_linuxptp

PTP IEEE 1588 stack for Linux
GNU General Public License v2.0
136 stars 60 forks source link

Error "clock jumped backward or running slower than expected!" #10

Open JohnRama opened 4 years ago

JohnRama commented 4 years ago

John tmp.log

vladimiroltean commented 4 years ago

Hi John, Does it help if you add the 'step_threshold 0.00002' setting to the gPTP.cfg file? Thanks, -Vladimir

JohnRama commented 4 years ago

Great thanks, Vladmir

Does it help if you add the 'step_threshold 0.00002' setting to the gPTP.cfg file? This helped a lot !!

However, if I keep repeated to modifying the time between 1500002055 and 1595964364 many times, sometimes same problem happens (probability is about 1 time per 20 trial) with the same message. ptp4l[521866.541]: clockcheck: clock jumped backward or running slower than expected!

So looks like there is some corner case...

P.S This problem never happens with ptp4l (version2.0) running on my Linux PC(I210).

John

vladimiroltean commented 4 years ago

What is the maximum frequency adjustment in parts per billion for enetc, and what is it for i210?

./testptp -c -d /dev/ptp0
capabilities:
  999999999 maximum frequency adjustment (ppb)
  0 programmable alarms
  2 external time stamp channels
  0 programmable periodic signals
  1 pulse per second
  0 programmable pins
  0 cross timestamping
  0 adjust_phase

If the max freq adjustment for i210 is below the default sanity frequency limit value of 200000000, then that's your answer. So, with enetc, what happens if you configure max_frequency and sanity_freq_limit both to 999999999? It'll no longer complain, that's for sure, but the question is: will it work?

JohnRama commented 4 years ago

Hi Vladimir,

Thank you for your reply.

On 2020/07/29 17:25, Vladimir Oltean wrote:

What is the maximum frequency adjustment in parts per billion for enetc, and what is it for i210?

./testptp -c -d /dev/ptp0 capabilities: 999999999 maximum frequency adjustment (ppb) 0 programmable alarms 2 external time stamp channels 0 programmable periodic signals 1 pulse per second 0 programmable pins 0 cross timestamping 0 adjust_phase

LS1028ARDB

$./testptp -c capabilities: 999999999 maximum frequency adjustment (ppb) 0 programmable alarms 2 external time stamp channels 0 programmable periodic signals 1 pulse per second 0 programmable pins 0 cross timestamping

Linux PC (I210)

$testptp -c -d /dev/ptp1 capabilities: 62499999 maximum frequency adjustment (ppb) 0 programmable alarms 2 external time stamp channels 2 programmable periodic signals 1 pulse per second 4 programmable pins 0 cross timestamping

If the max freq adjustment for i210 is below the default sanity frequency limit value of 200000000, then that's your answer. Yes, the max freq adjustment for I210 is 62499999, which is below 200000000.

So, with enetc, what happens if you configure |max_frequency| and |sanity_freq_limit| both to 999999999? It'll no longer complain, that's for sure, but the question is: will it work? Setting the 999999999 to both max_frequency and sanity_freq_limit resulted in the same problem.

Using the same number with I210(max_frequency to 62499999 and sanity_freq_limit to 200000000) resulted in the problem fixed. (at least I never see the problem so far.) $testptp -g always return the synced time.

I'm curious what was the root cause of this problem(who was wrong anyway ?? Changing GM time so much is not allowed ??), so I read the man page of ptp for the parameter explanation, and tried to understand the code, but coding of frequency check part of linuxptp is little bit complicated to me to understand the mechanism in a short time.

So if you or someone could explain a little bit more, it's really appreciated. But at least problem was fixed. So thank you very much !!

John

justdomyself commented 1 year ago

hello, i change my param from 999999999 to 62499999 on my slave device, the erros message is missing, but the ptp can not sync time from master?