Submit #3368
closed[PATCH] kern_clock: clean up whitespace; implement timeouts for `PPS_CANWAIT`
0%
Description
In the course of setting up a GPS-disciplined stratum 1 NTP server using gpsd and chrony, I found that `gpsd` wasn't able to track the PPS signal I'd wired into the DCD line of a UART. Investigating, I found that this was due to not supporting the `PPS_CANWAIT` functionality specified in RFC 2783; attempts to block until a PPS event fired would return `EOPNOTSUPP`. The corresponding functionality was in FreeBSD, and is very straight-forward: treat the event sequencers as atomic counters and loop over waiting for them to change, with a `tsleep` in the body of the loop and corresponding `wakeup` in the event handler. With this change, `gpsd` now sees PPS events and feeds PPS-corrected timestamps to chrony. Note that I didn't gate this on `PPS_SYNC`, though perhaps I should? I'm happy to revisit and make adjustments if there's consensus there.
These two patches capture the change, and also cleanup some trivial whitespace bogons (blanks at the ends of lines); the commits are separated in the spirit of keeping random cleanup separate from functionality changes.
Files
Updated by daftaupe 4 months ago
- Status changed from New to Resolved
Hey,
resolving this one as these patches have been merged as
https://gitweb.dragonflybsd.org/dragonfly.git/commit/0c4dbac108483594a0c23292c970faa8ab75465e
https://gitweb.dragonflybsd.org/dragonfly.git/commit/bbf175be7c123771a0fdbf33e95027bec8b3e14b
Thanks !