ptp4l: Set clock frequency on start.

Due to a bug in older kernels, frequency reading may silently fail and
return 0. Set the frequency to the read value to make sure the servo
has the actual frequency of the clock.

Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
master
Miroslav Lichvar 2013-04-04 17:28:21 +02:00 committed by Richard Cochran
parent 9ee5c1fb8e
commit da347d7a36
1 changed files with 4 additions and 0 deletions

View File

@ -597,6 +597,10 @@ struct clock *clock_create(int phc_index, struct interface *iface, int count,
if (c->clkid != CLOCK_INVALID) {
fadj = (int) clockadj_get_freq(c->clkid);
/* Due to a bug in older kernels, the reading may silently fail
and return 0. Set the frequency back to make sure fadj is
the actual frequency of the clock. */
clockadj_set_freq(c->clkid, fadj);
}
c->servo = servo_create(servo, -fadj, max_adj, sw_ts);
if (!c->servo) {