Bug 2699 - rtc: Fix set RTC time delay 500ms on some Zhaoxin SOCs
Summary: rtc: Fix set RTC time delay 500ms on some Zhaoxin SOCs
Status: RESOLVED FIXED
Alias: None
Product: ANCK 5.10 Dev
Classification: ANCK
Component: drivers (show other bugs) drivers
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: GuixinLiu
QA Contact: shuming
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-02 16:46 UTC by LeoLiu-oc
Modified: 2023-01-17 15:12 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description LeoLiu-oc zhaoxin_group 2022-11-02 16:46:32 UTC
Description of problem:
When the RTC divider is changed from reset to an operating time base,
the first update cycle should be 500ms later. But on some Zhaoxin SOCs,
this first update cycle is one second later.
So set RTC time on these Zhaoxin SOCs will causing 500ms delay.
Skip setup RTC divider on these SOCs in mc146818_set_time to fix it.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
测试时尽量不要联网或用ntp同步时间。这是因为系统时间同步ntp时间是一个渐进过程,容易导致测试时现象不明显
方法1
1、	hwclock –s 将RTC同步到系统时间
2、	hwclock –w 将系统时间写RTC里
3、	adjtimex –c 比较系统时间
方法2:
1、	启动时在BIOS setup时间,尽量使其北京时间相同
2、	hwclock –s 将RTC时间同步到系统中
3、	hwclock –w,将系统时间写到RTC里
4、	多执行几次2、3两步,
5、	hwclock –r读RTC时间,用其与北京时间比较,是否慢于北京时间


Actual results:


Expected results:
用方法1验证时,在执行adjtimex -c结果中system-cmos列其平均值不应超过0.5,一般会小于0.01
用方法2验证时,对比RTC时间和北京时间的差值,差值不大于1秒


Additional info:
Comment 1 maqiao alibaba_cloud_group 2023-01-17 15:12:46 UTC
merged: https://gitee.com/anolis/cloud-kernel/pulls/834