Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rtc drift issue #6410

Merged
merged 2 commits into from
Nov 13, 2024
Merged

Fix rtc drift issue #6410

merged 2 commits into from
Nov 13, 2024

Conversation

chenlin3
Copy link
Contributor

@chenlin3 chenlin3 commented Nov 6, 2024

Description

<Include a description of the change and why this change was made.>

<For each item, place an "x" in between [ and ] if true. Example: [x] (you can also check items in GitHub UI)>

<Create the PR as a Draft PR if it is only created to run CI checks.>

<Delete lines in <> tags before creating the PR.>

  • Breaking change?
    • Breaking change - Does this PR cause a break in build or boot behavior?
    • Examples: Does it add a new library class or move a module to a different repo.
  • Impacts security?
    • Security - Does this PR have a direct security impact?
    • Examples: Crypto algorithm change or buffer overflow fix.
  • Includes tests?
    • Tests - Does this PR include any explicit test code?
    • Examples: Unit tests or integration tests.

How This Was Tested

<Describe the test(s) that were run to verify the changes.>

Integration Instructions

<Describe how these changes should be integrated. Use N/A if nothing is required.>

@mdkinney
Copy link
Member

mdkinney commented Nov 7, 2024

The commit messages should typically only have one Signed-off-by tag

@chenlin3 chenlin3 force-pushed the fix_rtc_drift_issue branch 3 times, most recently from ed120e3 to 9468c6e Compare November 7, 2024 08:39
@chenlin3 chenlin3 force-pushed the fix_rtc_drift_issue branch 3 times, most recently from 5a5fb68 to d867654 Compare November 11, 2024 02:20
@niruiyu niruiyu added the push Auto push patch series in PR if all checks pass label Nov 11, 2024
@chenlin3 chenlin3 force-pushed the fix_rtc_drift_issue branch 2 times, most recently from a028820 to ff2f683 Compare November 11, 2024 05:09
@mdkinney mdkinney removed the push Auto push patch series in PR if all checks pass label Nov 11, 2024
@chenlin3 chenlin3 force-pushed the fix_rtc_drift_issue branch 2 times, most recently from 6e3b2c3 to 279b0e5 Compare November 12, 2024 03:43
Legacy BIOS design sets only the Update Cycle Inhibit (SET) bit when
changing the RTC time. Update Cycle Inhibit Bit may not be supported
by the backend device (Common I2C RTC device). It could add Division
Chain Select (DV) bit to stop the RTC first (Write to 0x07), Changing
the RTC time and then Set the DV bit back.

Signed-off-by: Di Zhang <[email protected]>
In PcRtcInit(), it always read RTC time and then write it back. It could
potentially cause two issues:
1) There is time gap between read RTC and write RTC, writing RTC time on
every boot could cause RTC time drift after many reboot cycles

2) Writing RTC registers on every boot could cause some unnecessary delay,
slightly impact the boot performance.

The change is only writing RTC time when 1) the current RTC time is not
valid or 2) the RegisterB value is changed.

Signed-off-by: Chen Lin Z <[email protected]>
@niruiyu niruiyu added the push Auto push patch series in PR if all checks pass label Nov 13, 2024
@mergify mergify bot merged commit 2839fed into tianocore:master Nov 13, 2024
126 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
push Auto push patch series in PR if all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants