Repository navigation
rtc: hibvt: do not set the clock to 1970 from a counter that lost power - #80
Merged
openipc-ai merged 1 commit intoOct 20, 2026
Conversation
This was referenced Oct 13, 2026
Author
|
/review |
Code Review by Qodo
1.
|
Author
|
/review |
|
Code review by qodo was updated up to the latest commit 200a92d |
Port of the hisilicon-hi3516ev200 fix. This branch has the same driver: a counter that lost power reads as 1970 and hctosys applies it, and the low-voltage flag is "cleared" by writing 1 to RTC_INT_CLR, which is the alarm bit. - read_time() returns -EINVAL for a counter before 2000-01-01, and set_time() refuses the same range, so every time it accepts can be read back. - Clear the low-voltage flag with LV_INT_MASK. The flag itself does not decide validity: on a hi3516ev300 it stays set with a fresh backup cell that keeps the time through a power cut.
openipc-ai
force-pushed
the
rtc/hibvt-low-voltage-hisilicon-hi3516cv500
branch
from
October 20, 2026 11:15
200a92d to
03f903e
Compare
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.
Port of #79 (hisilicon-hi3516ev200) to hisilicon-hi3516cv500. Read #79 for the analysis and the hardware results.
This branch's
rtc-hibvt.chas the same two defects:1toRTC_INT_CLR, which is the alarm bit.The change is the same as in #79:
read_time()returns-EINVALfor a counter before 2000-01-01, andset_time()refuses the same range, so every time it accepts can be read back (Qodo's review point).LV_INT_MASK.Verification
hi3516cv500.generic.config(CONFIG_ARCH_HI3516CV500=y).hi3516av300_lite, which runs on this branch). The built-in driver was unbound and the module was loaded in its place:hwclock: RTC_RD_TIME: Invalid argument).set_time()refuses times before 2000.