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, while free_running the phc_index is -1, thus causing a fault in the transition.
Hence, check for free_running before attempting to switch PHC. Signed-off-by: Eyal Itkin <eit...@nvidia.com> Reviewed-by: Rahul Rameshbabu <rrameshb...@nvidia.com> --- port.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/port.c b/port.c index 8b2eb04..e2520e6 100644 --- a/port.c +++ b/port.c @@ -2740,7 +2740,8 @@ 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 && + !clock_free_running(p->clock)) { 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