Skip the timestamp write checks for a locked clock - #39
Merged
Merged
Conversation
The two checks that write the timestamp register now read R_CLOCK_CONFIG first and skip when the device reports CLK_LOCK, since a locked device correctly refuses the write. The skip requires a positive CLK_LOCK, so a device reporting neither lock bit still runs both checks, and a failed read counts as not locked, since R_CLOCK_CONFIG is only recommended.
bruno-f-cruz
requested changes
Sep 13, 2026
bruno-f-cruz
left a comment
Member
There was a problem hiding this comment.
I think we should consider moving this test here
And report the functionality. In other words, it should become two tests:
-
Check if the clock is lockable/unlockable by writing to the register and listening for errors/returned value
-
Test if the 2 modes are correctly implemented, depending on the previous test
Contributor
Author
|
@bruno-f-cruz Agreed, that will be a follow-up PR which I already have and will commit after rebase. |
bruno-f-cruz
self-requested a review
September 13, 2026 17:49
bruno-f-cruz
approved these changes
Sep 13, 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.
The two checks that write
R_TIMESTAMP_SECONDnow readR_CLOCK_CONFIGfirst and skip when the device reportsCLK_LOCK, since a device with a locked timestamp register is correct to refuse the write. Without the guard such a device would report two errors, and because the exit code counts errors as well as failures, the whole run would exit 1.The guard is conservative in two directions, both deliberate. It skips only on a positive
CLK_LOCK, so a device that reports neither lock bit still runs both checks. And a failed read ofR_CLOCK_CONFIGcounts as not locked, since the register is only RECOMMENDED and a device that does not implement it has no lock state.Skippedis the right status because the checks are in scope and did not run, which is howClockTestSuitealready reports a missing--clock-port.Verified on hardware
Measured against a Behavior device on firmware 3.2, which supports locking and reports it conformantly, reading
0x40unlocked and0x80locked.The unlocked run is identical to the one before this change, so the guard does nothing on a device that is not locked.