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
parent
9ee5c1fb8e
commit
da347d7a36
4
clock.c
4
clock.c
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue