ia64/xen-unstable

changeset 16882:b321ef006189

x86: Fix host S3.

Time zone info just needs to be calculated in S3 suspend procedure.
However, time_suspend() is also called on AP. That wasteful
get_cmos_time() on AP may break __cpu_die() assumption since
get_cmos_time() can take up to one second. This fix just limits it to
running on the BSP.

Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Jan 25 13:26:38 2008 +0000 (2008-01-25)
parents 3f5dec2011b0
children 666573856c59
files xen/arch/x86/time.c
line diff
     1.1 --- a/xen/arch/x86/time.c	Fri Jan 25 13:23:39 2008 +0000
     1.2 +++ b/xen/arch/x86/time.c	Fri Jan 25 13:26:38 2008 +0000
     1.3 @@ -976,8 +976,11 @@ static long cmos_utc_offset; /* in secon
     1.4  
     1.5  int time_suspend(void)
     1.6  {
     1.7 -    cmos_utc_offset = (wc_sec + (wc_nsec + NOW()) / 1000000000ULL)
     1.8 -        - get_cmos_time();
     1.9 +    if ( smp_processor_id() == 0 )
    1.10 +    {
    1.11 +        cmos_utc_offset = -get_cmos_time();
    1.12 +        cmos_utc_offset += (wc_sec + (wc_nsec + NOW()) / 1000000000ULL);
    1.13 +    }
    1.14  
    1.15      /* Better to cancel calibration timer for accuracy. */
    1.16      kill_timer(&this_cpu(cpu_time).calibration_timer);