[Linuxptp-devel] [PATCH] phc2sys: Don't exit when reading of PHC fails.
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
|
From: Miroslav L. <mli...@re...> - 2022-03-10 11:23:24
|
Reading of the PHC can occasionally fail with some drivers, e.g. the ice
driver returns -EBUSY when it fails to get a lock. Change do_loop() to
ignore the error instead of exiting.
Signed-off-by: Miroslav Lichvar <mli...@re...>
---
phc2sys.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/phc2sys.c b/phc2sys.c
index 15dd689..281ec9d 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -730,7 +730,7 @@ static int do_loop(struct phc2sys_private *priv)
priv->master->sysoff_method,
priv->phc_readings,
&offset, &ts, &delay) < 0)
- return -1;
+ continue;
} else if (priv->master->clkid == CLOCK_REALTIME &&
clock->sysoff_method >= 0) {
/* use reversed sysoff */
@@ -738,7 +738,7 @@ static int do_loop(struct phc2sys_private *priv)
clock->sysoff_method,
priv->phc_readings,
&offset, &ts, &delay) < 0)
- return -1;
+ continue;
offset = -offset;
ts += offset;
} else {
@@ -747,7 +747,7 @@ static int do_loop(struct phc2sys_private *priv)
clock->clkid,
priv->phc_readings,
&offset, &ts, &delay))
- return -1;
+ continue;
}
update_clock(priv, clock, offset, ts, delay);
}
--
2.35.1
|