Project

General

Profile

Actions

Submit #3368

closed

[PATCH] kern_clock: clean up whitespace; implement timeouts for `PPS_CANWAIT`

Added by dancrossnyc 6 months ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Kernel
Target version:
Start date:
05/11/2024
Due date:
% Done:

0%

Estimated time:

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

0002-pps_fetch-introduce-a-helper-to-handle-timeouts.patch (2.85 KB) 0002-pps_fetch-introduce-a-helper-to-handle-timeouts.patch Implement timeout support for PPS_IOC_FETCH and expose PPS_CANWAIT capability dancrossnyc, 05/11/2024 05:40 AM
0001-trivial-Clean-up-white-space-at-ends-of-lines.patch (5.5 KB) 0001-trivial-Clean-up-white-space-at-ends-of-lines.patch Trivial whitespace cleanup dancrossnyc, 05/11/2024 05:40 AM
Actions

Also available in: Atom PDF