Skip to content

fix: register DPLL pins on both EEC and PPS devices - #6

Closed
bnshr wants to merge 4 commits into
fix-dashboardfrom
fix/register-pins-both-dplls
Closed

fix: register DPLL pins on both EEC and PPS devices#6
bnshr wants to merge 4 commits into
fix-dashboardfrom
fix/register-pins-both-dplls

Conversation

@bnshr

@bnshr bnshr commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Register GNSS, external (SMA/U.FL), and port (SyncE) pins on both EEC and PPS DPLLs, matching real E810 driver behavior
  • Fixes clock class stuck at 248 (FREERUN) in GNSS simulation CI tests

Root Cause

linuxptp-daemon's PhaseOffsetPin() checks len(pin.ParentDevice) > PPS_PIN_INDEX (where PPS_PIN_INDEX = 1). With pins only registered on PPS DPLL, ParentDevice has 1 entry, the check fails, phase offset stays at FaultyPhaseOffset (99999999999), isOffsetInRange() returns false, and ptp4l stays at clock class 248 even when DPLL reports LOCKED_HO_ACQ.

Fix

Register all pins on both EEC (index 0) and PPS (index 1) DPLLs so each pin gets two parent device entries and the phase offset is read from ParentDevice[1].PhaseOffset correctly.

Test plan

  • CI ptp-test (tgm) job passes with clock class reaching 6
  • CI ptp-test (tgmbc) job passes
  • scripts/test-dpll.sh passes on VM

bnshr added 4 commits July 24, 2026 14:50
The GNSS pin (and ext/port pins) were only registered on the PPS DPLL,
resulting in pin.ParentDevice having a single entry. linuxptp-daemon's
PhaseOffsetPin() requires len(ParentDevice) > PPS_PIN_INDEX (1) to read
the phase offset — with only one parent the check fails, phaseOffset
stays at FaultyPhaseOffset (99999999999), isOffsetInRange() returns
false, and ptp4l remains at clock class 248 even when DPLL reports
LOCKED_HO_ACQ.

Register all pins on both EEC (index 0) and PPS (index 1) DPLLs,
matching real E810 driver behavior. This gives each pin two parent
device entries so the phase offset is read correctly and ptp4l can
transition to clock class 6.
Use bnshr/ptp-operator@integrate-add-gnss so CI exercises the GNSS
simulation work that this DPLL pin fix targets.
linuxptp-daemon enables periodic NAV-STATUS/NAV-CLOCK via
CFG-MSGOUT-UBX_NAV_* CFG-VALSET keys, not classic CFG-MSG.
netdevsim only started the 1 Hz emitter on CFG-MSG, so ubxtool
never saw NAV frames, GNSS stayed s0, and ptp4l remained at
clock class 248 despite DPLL/ts2phc being locked.

Recognize CFG-MSGOUT STATUS/CLOCK keys (group 0x91) with a
non-zero rate and start the NAV timer, matching real receiver
behavior used by the daemon.
When gnss-sim reports NMEA fix quality 0, update gpsFix and transition
kernel DPLL from locked to holdover (with netlink notify), matching the
UBX INFIL path. Do not clobber sysfs freerun while GGA stays invalid.
@bnshr bnshr closed this Jul 29, 2026
@bnshr
bnshr deleted the fix/register-pins-both-dplls branch July 29, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant