A Boundary Clock might choose to switch a PHC when jbod is active,
and the transition will be based on the port's phc_index. However,
when using the slave event monitoring + free_running the phc_index
is -1, thus causing a fault in the transition.

Hence, avoid switching the PHC in case phc_index is negative.

Signed-off-by: Eyal Itkin <eit...@nvidia.com>
Reviewed-by: Rahul Rameshbabu <rrameshb...@nvidia.com>
---
 port.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/port.c b/port.c
index 8b2eb04..d551bef 100644
--- a/port.c
+++ b/port.c
@@ -2740,7 +2740,7 @@ static void bc_dispatch(struct port *p, enum fsm_event 
event, int mdiff)
                port_e2e_transition(p, p->state);
        }
 
-       if (p->jbod && p->state == PS_UNCALIBRATED) {
+       if (p->jbod && p->state == PS_UNCALIBRATED && p->phc_index >= 0 ) {
                if (clock_switch_phc(p->clock, p->phc_index)) {
                        p->last_fault_type = FT_SWITCH_PHC;
                        port_dispatch(p, EV_FAULT_DETECTED, 0);
-- 
2.21.0



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

Reply via email to