The pmc_agent_update() function is called once per clock update. If the
clock update rate configured with -R is smaller than 1 per minute,
adjust the subscription interval to avoid gaps in its coverage.

Signed-off-by: Miroslav Lichvar <mlich...@redhat.com>
---
 phc2sys.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/phc2sys.c b/phc2sys.c
index 4dc7a9a..451b85f 100644
--- a/phc2sys.c
+++ b/phc2sys.c
@@ -942,7 +942,9 @@ static int auto_init_ports(struct domain *domain)
                return -1;
        }
 
-       err = pmc_agent_subscribe(domain->agent, 1000, 180);
+       err = pmc_agent_subscribe(domain->agent, 1000,
+                                 (60 > domain->phc_interval ?
+                                  60 : domain->phc_interval) * 3);
        if (err) {
                pr_err("failed to subscribe");
                return -1;
-- 
2.41.0



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

Reply via email to