Bug 2576 - 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 4.19 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-10-26 11:37 UTC by LeoLiu-oc
Modified: 2023-01-17 15:11 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-10-26 11:37:23 UTC
Description of problem:
Linux设置RTC时间是会在系统时间0.5秒的时间点发起写RTC的操作,kernel在写RTC时间时会将DV[2:0]置1进行reset,接着将时间更新到RTC中,之后将DV[2:0]的值恢复。根据spec要求DV[2:0]恢复后的第一笔update cycle应该在500ms,但在某些chipset上第一笔update cycle则在1s以后

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

How reproducible:


Steps to Reproduce:
1.hwclock –s 将RTC同步到系统时间
2.hwclock –w 将系统时间写RTC里
3.adjtimex –c 比较系统时间

Actual results:
在执行adjtimex -c结果中system-cmos列其平均值超过0.5

Expected results:
在执行adjtimex -c结果中system-cmos列其平均值不应超过0.5,一般会小于0.01

Additional info:
测试时尽量不要联网或用ntp同步时间。这是因为系统时间同步ntp时间是一个渐进过程,容易导致测试时现象不明显
Comment 1 maqiao alibaba_cloud_group 2023-01-17 15:11:53 UTC
merged: https://gitee.com/anolis/cloud-kernel/pulls/792