]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
x86, time: fix S3 suspend error
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 2 Mar 2009 14:17:05 +0000 (14:17 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 2 Mar 2009 14:17:05 +0000 (14:17 +0000)
platform_time_calibration() is invoked in S3 when irq is disabled,
which causes ASSERT() error in spin_lock_irq(). spin_lock_irqsave()
saves us.

Signed-off-by: Guanqun Lu <guanqun.lu@intel.com>
xen-unstable changeset:   19240:9af46734ce70fcc7e89f3af1ace876652ec9478f
xen-unstable date:        Sun Mar 01 14:30:35 2009 +0000

xen/arch/x86/time.c

index b4e6944352be2c9100ebe9be7a19aed8a694e377..e6fc7ab54b3d2041f4712423c2b6600c5f7aad2c 100644 (file)
@@ -590,13 +590,14 @@ static void platform_time_calibration(void)
 {
     u64 count;
     s_time_t stamp;
+    unsigned long flags;
 
-    spin_lock_irq(&platform_timer_lock);
+    spin_lock_irqsave(&platform_timer_lock, flags);
     count = plt_stamp64 + ((plt_src.read_counter() - plt_stamp) & plt_mask);
     stamp = __read_platform_stime(count);
     stime_platform_stamp = stamp;
     platform_timer_stamp = count;
-    spin_unlock_irq(&platform_timer_lock);
+    spin_unlock_irqrestore(&platform_timer_lock, flags);
 }
 
 static void resume_platform_timer(void)