drivers/timers, arch/arm/stm32: fix a PTP dummy clock typo and a stale comment. - #20207
Merged
acassis merged 2 commits intoSep 20, 2026
Merged
Conversation
…time. ptp_clock_dummy_getcrosststamp() stored the seconds of the monotonic clock in the nanoseconds field of the monoraw member, so the monotonic time of the cross timestamp was wrong. Store the nanoseconds. Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com> Assisted-by: Claude:claude-sonnet-5
The comment of stm32_eth_ptp_convert_rxtime() said that it converts to CLOCK_REALTIME. Since the timestamp is delivered as the value of the PTP counter of the MAC, which is the time base of /dev/ptp0, say that. Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com> Assisted-by: Claude:claude-sonnet-5
daniel-p-carvalho
requested review from
fjpanag and
xiaoxiang781216
as code owners
September 20, 2026 16:58
simbit18
approved these changes
Sep 20, 2026
cederom
approved these changes
Sep 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two small corrections to code that was merged before, both found while checking the PTP clock documentation against the code.
ptp_clock_dummy_getcrosststamp()indrivers/timers/ptp_clock_dummy.cstored the seconds of the monotonic clock in the nanoseconds field ofmonoraw, so the monotonic time of the cross timestamp was wrong. It now stores the nanoseconds. The two lines above it, for the device and the real-time clock, already copy the right fields.arch/arm/src/common/stm32/stm32_eth_m3m4_v1.cthe comment ofstm32_eth_ptp_convert_rxtime()said that it converts the RX timestamp toCLOCK_REALTIME. Since arch/arm/stm32: implement PTP hardware clock driver (/dev/ptp0) #20180 the function delivers the value of the PTP counter of the MAC, which is the time base of/dev/ptp0, so the comment says that now. It changes no code.Impact
The first commit changes the value that the dummy PTP clock returns in
monorawforPTP_SYS_OFFSET_PRECISE. Nothing else in the tree reads it. The second commit changes a comment only.Testing
Both points were confirmed by reading the code. The dummy driver was compiled (syntax check with the ARM toolchain, no warnings) and
./tools/checkpatch.shpasses for both commits. The effect of the first fix was not run: it only shows in the result ofPTP_SYS_OFFSET_PRECISEon the dummy clock, for example in a simulator test.