WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] xen, s3: Sync platform stamps at time suspend

To: 'xen-devel' <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] xen, s3: Sync platform stamps at time suspend
From: "Tian, Kevin" <kevin.tian@xxxxxxxxx>
Date: Wed, 19 Nov 2008 17:43:29 +0800
Accept-language: en-US
Acceptlanguage: en-US
Delivery-date: Wed, 19 Nov 2008 01:43:56 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AclKK0cPZGu9FEEwRiygxFNRGpe56w==
Thread-topic: [PATCH] xen, s3: Sync platform stamps at time suspend
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@xxxxxxxxx>

diff -r c34432349a30 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c       Wed Nov 19 08:32:55 2008 +0800
+++ b/xen/arch/x86/time.c       Wed Nov 19 09:04:10 2008 +0800
@@ -580,8 +580,7 @@ static void resume_platform_timer(void)
     if ( plt_src.resume )
         plt_src.resume(&plt_src);
 
-    /* No change in platform_stime across suspend/resume. */
-    platform_timer_stamp = plt_stamp64;
+    plt_stamp64 = platform_timer_stamp;
     plt_stamp = plt_src.read_counter();
 }
 
@@ -1216,6 +1215,9 @@ int time_suspend(void)
         cmos_utc_offset = -get_cmos_time();
         cmos_utc_offset += (wc_sec + (wc_nsec + NOW()) / 1000000000ULL);
         kill_timer(&calibration_timer);
+
+        /* Sync platform timer stamps. */
+        platform_time_calibration();
     }
 
     /* Better to cancel calibration timer for accuracy. */

Attachment: plt_timer_sync.patch
Description: plt_timer_sync.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] xen, s3: Sync platform stamps at time suspend, Tian, Kevin <=