Skip to content

Commit e9efff6

Browse files
yangbolu1991kartben
authored andcommitted
net: ptp: calculate link delay with right timestamps
At the starting of ptp syncrhonization, there may be not Sync frame TX/RX timestamps in first time link delay calculation. So, need a check for that in case of wrong link delay calculated. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
1 parent a167c2d commit e9efff6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

subsys/net/lib/ptp/clock.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,10 @@ void ptp_clock_delay(uint64_t egress, uint64_t ingress)
556556
{
557557
int64_t delay;
558558

559+
if (ptp_clk.timestamp.t1 == 0 || ptp_clk.timestamp.t2 == 0) {
560+
return;
561+
}
562+
559563
ptp_clk.timestamp.t3 = egress;
560564
ptp_clk.timestamp.t4 = ingress;
561565

0 commit comments

Comments
 (0)