===== arch/ia64/kernel/time.c 1.35 vs edited ===== --- 1.35/arch/ia64/kernel/time.c Wed Oct 8 12:53:38 2003 +++ edited/arch/ia64/kernel/time.c Fri Oct 10 09:49:37 2003 @@ -72,10 +72,16 @@ itc_get_offset (void) { unsigned long elapsed_cycles, lost = jiffies - wall_jiffies; - unsigned long now = ia64_get_itc(), last_tick; + unsigned long now, last_tick; last_tick = (cpu_data(TIME_KEEPER_ID)->itm_next - (lost + 1)*cpu_data(TIME_KEEPER_ID)->itm_delta); + + /* + * get now after last_tick to avoid race condition where + * itm_next might be updated. + */ + now = ia64_get_itc(); if (unlikely((long) (now - last_tick) < 0)) { printk(KERN_ERR "CPU %d: now < last_tick (now=0x%lx,last_tick=0x%lx)!\n",