On Thu, Aug 30, 2018 at 04:54:37PM -0700, Vedang Patel wrote:
> diff --git a/clock.c b/clock.c
> index 0f2e319a19c7..eef534aea718 100644
> --- a/clock.c
> +++ b/clock.c
> @@ -1136,6 +1136,15 @@ struct clock *clock_create(enum clock_type type,
> struct config *config,
>
> LIST_FOREACH(p, &c->ports, list) {
> port_dispatch(p, EV_INITIALIZE, 0);
> +
> + /*
> + * Generate an event to trigger a transition from PS_LISTENING
> + * to the respective PS_MASTER/PS_SLAVE state for BMCA with
> + * designated master and slave.
> + */
> + if (port_bmca(p) == BMCA_NOOP) {
> + port_dispatch(p, EV_ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES,
> 0);
> + }
> }
> port_dispatch(c->uds_port, EV_INITIALIZE, 0);
>
> @@ -1502,6 +1511,14 @@ int clock_poll(struct clock *c)
> if (PS_FAULTY == port_state(p)) {
> clock_fault_timeout(p, 1);
> break;
> + } else if (port_state(p) == PS_LISTENING &&
> + port_bmca(p) == BMCA_NOOP) {
> + /*
> + * PS_LISTENING is just a transitory
> + * state in BMCA with designated master
> + * and slave.
> + */
> + port_dispatch(p,
> EV_ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES, 0);
Remember: if you hack the core code, then you are probably doing it wrong.
^^^ That goes double for clock_poll().
Thanks,
Richard
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel