ia64/xen-unstable
changeset 18812:4c67985c552e
x86, s3: Sync platform stamps at time suspend.
platform_timer_stamp and stime_platform_stamp are synced
to platform timer in time calibration (1s interval), and
thus doesn't reflect the latest value. If they're not
synced at time suspend, the offset can be lost after S3
resume. Average 0.8s lag-behind is observed for each S3
action, which accumulates to TOD inaccuracy.
Signed-off-by Kevin Tian <kevin.tian@intel.com>
platform_timer_stamp and stime_platform_stamp are synced
to platform timer in time calibration (1s interval), and
thus doesn't reflect the latest value. If they're not
synced at time suspend, the offset can be lost after S3
resume. Average 0.8s lag-behind is observed for each S3
action, which accumulates to TOD inaccuracy.
Signed-off-by Kevin Tian <kevin.tian@intel.com>
author | Keir Fraser <keir.fraser@citrix.com> |
---|---|
date | Wed Nov 19 13:17:31 2008 +0000 (2008-11-19) |
parents | 390ef36eb596 |
children | 4107618ee0d8 |
files | xen/arch/x86/time.c |
line diff
1.1 --- a/xen/arch/x86/time.c Wed Nov 19 13:13:39 2008 +0000 1.2 +++ b/xen/arch/x86/time.c Wed Nov 19 13:17:31 2008 +0000 1.3 @@ -585,8 +585,7 @@ static void resume_platform_timer(void) 1.4 if ( plt_src.resume ) 1.5 plt_src.resume(&plt_src); 1.6 1.7 - /* No change in platform_stime across suspend/resume. */ 1.8 - platform_timer_stamp = plt_stamp64; 1.9 + plt_stamp64 = platform_timer_stamp; 1.10 plt_stamp = plt_src.read_counter(); 1.11 } 1.12 1.13 @@ -1221,6 +1220,9 @@ int time_suspend(void) 1.14 cmos_utc_offset = -get_cmos_time(); 1.15 cmos_utc_offset += (wc_sec + (wc_nsec + NOW()) / 1000000000ULL); 1.16 kill_timer(&calibration_timer); 1.17 + 1.18 + /* Sync platform timer stamps. */ 1.19 + platform_time_calibration(); 1.20 } 1.21 1.22 /* Better to cancel calibration timer for accuracy. */