Thread: [Linuxptp-users] ptp4l/phc2sys: Linux 'date' incorrect
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Harold L. <hla...@pi...> - 2015-09-15 16:32:24
|
To Whom It May Concern, Have ptp4l/phc2sys running on 3 separate systems, start system 1 and then system 2 and the output looks good ( using -m attribute) but when system 3 is started a 'GRAND_MASTER' to Faulty occurs. System 3 is immediately removed but system 2 is showing a huge master offset and it starts to slowly come down but takes 20 - 30 minutes. Have stopped and restarted system 2 but it continues with a huge master offset that continues to move downward. How does one get a system to recover quickly from this type of issue (i.e., 20 - 30 minutes is unreasonable and powering the unit ON/OFF isn't an option)? Thanks, Harold system 1: ptp4l: root@zx3-pm3-zynq7:~# ptp4l -i eth0 -m ptp4l[134.005]: port 1: INITIALIZING to LISTENING on INITIALIZE ptp4l[134.006]: port 0: INITIALIZING to LISTENING on INITIALIZE ptp4l[134.878]: port 1: new foreign master 00214a.fffe.000007-1 ptp4l[138.752]: selected best master clock 00214a.fffe.000007 ptp4l[138.753]: assuming the grand master role ptp4l[138.753]: port 1: LISTENING to GRAND_MASTER on RS_GRAND_MASTER phc2sys: root@zx3-pm3-zynq7:~# phc2sys -a -r -r -m hc2sys[216.598]: sys offset 46 s2 freq -1 delay 9936 phc2sys[217.599]: sys offset 69 s2 freq +36 delay 9891 phc2sys[218.599]: sys offset 9 s2 freq -3 delay 9908 phc2sys[219.600]: sys offset -72 s2 freq -82 delay 9918 phc2sys[220.600]: sys offset -41 s2 freq -72 delay 9837 system2: ptp4l: root@zx3-pm3-zynq7:~# ptp4l -i eth0 -m ptp4l[10299.159]: master offset 13496 s2 freq -92511 path delay 30399 ptp4l[10300.259]: master offset 6068 s2 freq -95890 path delay 30399 ptp4l[10301.359]: master offset 2295 s2 freq -97843 path delay 30399 ptp4l[10302.459]: master offset -787 s2 freq -100236 path delay 30399 ptp4l[10303.559]: master offset 576 s2 freq -99110 path delay 29807 ptp4l[10304.659]: master offset 3480 s2 freq -96033 path delay 27695 ptp4l[10305.759]: master offset 1531 s2 freq -96938 path delay 27059 ptp4l[10306.859]: master offset 46 s2 freq -97963 path delay 27059 system 3: brought up: ptp4l[10826.010]: selected best master clock 000a35.fffe.00da5e ptp4l[10826.010]: port 1: SLAVE to UNCALIBRATED on RS_SLAVE ptp4l[10828.010]: master offset 318377681381 s2 freq +32767999 path delay 9823 ptp4l[10828.010]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED ptp4l[10829.002]: master offset 318344852456 s2 freq +32767999 path delay 9823 ptp4l[10829.975]: master offset 318309408666 s2 freq +32767999 path delay 2590734 ptp4l[10830.935]: master offset 318276417859 s2 freq +32767999 path delay 2706681 system 3 removed: . . . ptp4l[10826.010]: selected best master clock 000a35.fffe.00da5e ptp4l[10826.010]: port 1: SLAVE to UNCALIBRATED on RS_SLAVE ptp4l[10828.010]: master offset 318377681381 s2 freq +32767999 path delay 9823 ptp4l[10828.010]: port 1: UNCALIBRATED to SLAVE on MASTER_CLOCK_SELECTED ptp4l[10829.002]: master offset 318344852456 s2 freq +32767999 path delay 9823 ptp4l[10829.975]: master offset 318309408666 s2 freq +32767999 path delay 2590734 ptp4l[10830.935]: master offset 318276417859 s2 freq +32767999 path delay 2706681 . . (20 - 30 minutes) . ptp4l[11563.398]: master offset 26 s2 freq -108134 path delay 2554197 ptp4l[11564.300]: master offset 1272234 s2 freq +1164082 path delay 1290161 ptp4l[11565.197]: master offset 844850 s2 freq +1118368 path delay 458005 ptp4l[11566.098]: master offset -373946 s2 freq +153027 path delay 458005 ptp4l[11566.998]: master offset -426947 s2 freq -12157 path delay 257305 ptp4l[11567.898]: master offset -513853 s2 freq -227148 path delay 257305 ptp4l[11568.798]: master offset -170513 s2 freq -37963 path delay 41365 ptp4l[11569.698]: master offset -231087 s2 freq -149691 path delay 41365 ptp4l[11570.598]: master offset -161630 s2 freq -149560 path delay 23074 ptp4l[11571.498]: master offset -111912 s2 freq -148331 path delay 23074 ptp4l[11572.398]: master offset -62601 s2 freq -132594 path delay 23074 ptp4l[11573.298]: master offset -31339 s2 freq -120112 path delay 25772 ptp4l[11574.198]: master offset -10658 s2 freq -108833 path delay 25949 ptp4l[11575.098]: master offset -312 s2 freq -101684 path delay 25949 ptp4l[11575.998]: master offset 2400 s2 freq -99066 path delay 25949 ptp4l[11576.898]: master offset 3233 s2 freq -97513 path delay 25949 ptp4l[11577.798]: master offset 2215 s2 freq -97561 path delay 26035 ptp4l[11578.698]: master offset 1507 s2 freq -97605 path delay 26035 ptp4l[11579.598]: master offset 1025 s2 freq -97635 path delay 26546 ptp4l[11580.498]: master offset -221 s2 freq -98573 path delay 26813 ptp4l[11581.398]: master offset 730 s2 freq -97688 path delay 26813 ptp4l[11582.298]: master offset 119 s2 freq -98080 path delay 26813 phc2sys: root@zx3-pm3-zynq7:~# phc2sys -a -r -r -m phc2sys[10432.994]: phc offset 474 s2 freq -99007 delay 2727 phc2sys[10433.994]: phc offset 638 s2 freq -98701 delay 2677 phc2sys[10434.995]: phc offset -302 s2 freq -99450 delay 2682 phc2sys[10435.995]: phc offset 108 s2 freq -99130 delay 2682 phc2sys[10436.996]: phc offset 325 s2 freq -98881 delay 2679 phc2sys[10437.996]: phc offset -264 s2 freq -99372 delay 2682 phc2sys[10438.997]: phc offset -483 s2 freq -99670 delay 2682 phc2sys[10439.997]: phc offset 506 s2 freq -98826 delay 2706 phc2sys[10440.998]: phc offset -796 s2 freq -99977 delay 2686 system 3 brought up: phc2sys[11555.873]: phc offset -4 s2 freq +32768017 delay 2591 phc2sys[11556.873]: phc offset 7 s2 freq +32768027 delay 2614 phc2sys[11557.874]: phc offset -6 s2 freq +32768016 delay 2589 phc2sys[11558.874]: phc offset -8 s2 freq +32768012 delay 2605 phc2sys[11559.875]: port 00214a.fffe.000007-1 changed state phc2sys[11559.876]: reconfiguring after port state change phc2sys[11559.876]: master clock not ready, waiting... phc2sys[11562.877]: port 00214a.fffe.000007-1 changed state phc2sys[11562.878]: reconfiguring after port state change phc2sys[11562.878]: selecting CLOCK_REALTIME for synchronization phc2sys[11562.878]: selecting eth0 as the master clock phc2sys[11562.878]: phc offset 293403920992 s2 freq +100000000 delay 2641 phc2sys[11563.879]: phc offset 293292168858 s2 freq +100000000 delay 2410 phc2sys[11564.879]: phc offset 293181588380 s2 freq +100000000 delay 2416 . . (20 - 30 minutes) . phc2sys[10848.490]: phc offset 262 s2 freq +32767701 delay 2640 phc2sys[10849.494]: phc offset 596 s2 freq +32768114 delay 2594 phc2sys[10850.495]: phc offset 507 s2 freq +32768204 delay 2591 phc2sys[10851.496]: phc offset 300 s2 freq +32768149 delay 2704 phc2sys[10852.496]: phc offset 186 s2 freq +32768125 delay 2597 phc2sys[10853.497]: phc offset 79 s2 freq +32768074 delay 2594 phc2sys[10854.497]: phc offset 14 s2 freq +32768032 delay 2638 phc2sys[10855.498]: phc offset 18 s2 freq +32768040 delay 2591 phc2sys[10856.499]: phc offset -1 s2 freq +32768027 delay 2594 system 3: ptpl4: root@zx3-pm3-zynq7:~# ptp4l -i eth0 -m ptp4l[9570.777]: selected /dev/ptp0 as PTP clock ptp4l[9570.781]: driver changed our HWTSTAMP options ptp4l[9570.782]: tx_type 1 not 1 ptp4l[9570.782]: rx_filter 1 not 12 ptp4l[9570.783]: port 1: INITIALIZING to LISTENING on INITIALIZE ptp4l[9570.784]: port 0: INITIALIZING to LISTENING on INITIALIZE ptp4l[9572.743]: port 1: new foreign master 000a35.fffe.01225c-1 ptp4l[9576.743]: selected best master clock 000a35.fffe.01225c ptp4l[9576.744]: assuming the grand master role ptp4l[9576.744]: port 1: LISTENING to GRAND_MASTER on RS_GRAND_MASTER ptp4l[9593.749]: timed out while polling for tx timestamp ptp4l[9593.749]: increasing tx_timestamp_timeout may correct this issue, but it is likely caused by a driver bug ptp4l[9593.749]: port 1: send sync failed ptp4l[9593.749]: port 1: GRAND_MASTER to FAULTY on FAULT_DETECTED (FT_UNSPECIFIED) ptp4l[9609.753]: driver changed our HWTSTAMP options ptp4l[9609.754]: tx_type 1 not 1 ptp4l[9609.755]: rx_filter 1 not 12 ptp4l[9609.755]: port 1: FAULTY to LISTENING on FAULT_CLEARED ptp4l[9611.049]: port 1: new foreign master 000a35.fffe.01225c-1 |
From: Richard C. <ric...@gm...> - 2015-09-15 17:38:03
|
On Tue, Sep 15, 2015 at 04:32:09PM +0000, Harold Lapprich wrote: > How does one get a system to recover quickly from this type of issue > (i.e., 20 - 30 minutes is unreasonable and powering the unit ON/OFF > isn't an option)? Use the step_threshold configuration option. From the man page: step_threshold The maximum offset the servo will correct by changing the clock frequency instead of stepping the clock. When set to 0.0, the servo will never step the clock except on start. It's specified in seconds. The default is 0.0. This option used to be called pi_offset_const. Richard |
From: Harold L. <hla...@pi...> - 2015-09-15 19:40:51
|
Richard, Thanks for the quick response. Did a search on the web for 'ptp4l man' and came up with a number of man documents that didn't have 'step_theshold' shown so I suspect they're from older linuxptp releases. Came across a URL document that shows 'step_theshold' being 1.0 by default but suspect this is incorrect due to your earlier response (or they have a default configuration file that is being referenced) but the document is a good reference for the specification/setting of ptp4l configuration file parameters. Do you have a 'step_theshold' value you would recommend (for that matter do you have a default configuration file recommendation)? What is the latest release of 'linuxptp' (a new version due to be released anytime soon)? Thanks, Harold URL: http://nineways.co.uk/DMA-uCLinux_ptp1588_RG_1.0.pdf AMBA DMA Controller uCLinux PTP-1588 Reference Guide ~]# ptp4l -f /ptp/defult.cfg A configuration file equivalent to the -i /dev/mtip3 -m -S options shown above would look as follows: ~]# cat default.cfg [global] verbose 1 time_stamping software [/dev/mtip3] The actual default.cfg contents are as follows: [global] twoStepFlag 1 slaveOnly 0 priority1 128 priority2 128 domainNumber 0 clockClass 248 clockAccuracy 0xFE offsetScaledLogVariance 0xFFFF free_running 0 freq_est_interval 1 logAnnounceInterval 1 logSyncInterval 0 logMinDelayReqInterval 0 logMinPdelayReqInterval 0 announceReceiptTimeout 3 syncReceiptTimeout 0 delayAsymmetry 0 fault_reset_interval 4 neighborPropDelayThresh 20000000 assume_two_step 0 logging_level 6 path_trace_enabled 0 follow_up_info 1 tx_timestamp_timeout 1 use_syslog 0 verbose 1 summary_interval 0 kernel_leap 1 pi_proportional_const 0.0 pi_integral_const 0.0 pi_proportional_scale 0.0 pi_proportional_exponent -0.3 pi_proportional_norm_max 0.7 pi_integral_scale 0.0 pi_integral_exponent 0.4 pi_integral_norm_max 0.3 step_threshold 1 first_step_threshold 0.00005 max_frequency 900000000 clock_servo pi sanity_freq_limit 200000000 ntpshm_segment 0 transportSpecific 0x0 ptp_dst_mac 01:1B:19:00:00:00 p2p_dst_mac 01:80:C2:00:00:0E udp6_scope 0x0 uds_address /etc/uds/ptp4l delay_mechanism Auto time_stamping hardware delay_filter moving_median delay_filter_length 10 productDescription ;product name; revisionData ;MorethanIP-SWITCH/MAC-V0.1; manufacturerIdentity FF:01:22 userDescription Hardware timer counter in Fabric/Hardware [FF:01:22] - MTIP/NW identifier timeSource 0xA0 [/dev/mtip3] -----Original Message----- From: Richard Cochran [mailto:ric...@gm...] Sent: Tuesday, September 15, 2015 1:38 PM To: Harold Lapprich <hla...@pi...> Cc: lin...@li... Subject: Re: [Linuxptp-users] ptp4l/phc2sys: Linux 'date' incorrect On Tue, Sep 15, 2015 at 04:32:09PM +0000, Harold Lapprich wrote: > How does one get a system to recover quickly from this type of issue > (i.e., 20 - 30 minutes is unreasonable and powering the unit ON/OFF > isn't an option)? Use the step_threshold configuration option. From the man page: step_threshold The maximum offset the servo will correct by changing the clock frequency instead of stepping the clock. When set to 0.0, the servo will never step the clock except on start. It's specified in seconds. The default is 0.0. This option used to be called pi_offset_const. Richard |
From: Richard C. <ric...@gm...> - 2015-09-15 20:26:55
|
On Tue, Sep 15, 2015 at 07:40:41PM +0000, Harold Lapprich wrote: > Thanks for the quick response. Did a search on the web for 'ptp4l > man' Why search around when you could just go to the source instead? http://sourceforge.net/projects/linuxptp Click on the big green button to download the lastest offical release. The man pages are included. To read the ptp4l man page, type "man -l ptp4l.8". > Do you have a 'step_theshold' value you would recommend No, that is really up to you. > (for that matter do you have a default configuration file > recommendation)? The file, default.cfg, is included in the TGZ file. > What is the latest release of 'linuxptp' (a new version due to be released anytime soon)? See: http://sourceforge.net/projects/linuxptp Richard |