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 <mlich...@redhat.com>
---
 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



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to