We activate on-step mode based on the "time_stamping" and
"twoStepFlag" configuration options.  If twoStepFlag is false and HW
time stamping is enabled, we upgrade the time stamping mode variable
to one-step.

The code that tests the options and sets the one-step mode moved from
ptp4l.c into clock.c in commit 9b27664c ("clock: simplify the create
method.").  However, that commit inadvertently moved the test after
the place where the time stamping mode is latched in a local variable.
As a result, one-step mode is not activated when configured.

This patch fixes the issue by keeping the local time stamping mode
variable up to date during the one-step test.

Signed-off-by: Richard Cochran <richardcoch...@gmail.com>
 clock.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clock.c b/clock.c
index 0107ef2..55f3c52 100644
--- a/clock.c
+++ b/clock.c
@@ -898,6 +898,7 @@ struct clock *clock_create(enum clock_type type, struct 
config *config,
                               "with hardware time stamping");
                        return NULL;
                case TS_HARDWARE:
+                       timestamping = TS_ONESTEP;
                        if (config_set_int(config, "time_stamping", TS_ONESTEP))
                                return NULL;

Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
Linuxptp-devel mailing list

Reply via email to