ia64/xen-unstable

changeset 5075:543ffea3fc12

bitkeeper revision 1.1159.258.151 (428f2c2a_3sOeZVGhQutbJc15aCU9g)

Fix e1000 hang during reboot bug. Kudos to Steven Hand for analyzing.
time.c:
Fix bug in code which sets our one-shot timer when we decide to block during
the idle loop.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Sat May 21 12:40:10 2005 +0000 (2005-05-21)
parents c4353a81ae5b
children d55569f2ac18 2a5814ad2e56 b6c2b1279260
files linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c
line diff
     1.1 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c	Fri May 20 23:16:46 2005 +0000
     1.2 +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c	Sat May 21 12:40:10 2005 +0000
     1.3 @@ -656,7 +656,12 @@ void __init time_init(void)
     1.4  /* Convert jiffies to system time. Call with xtime_lock held for reading. */
     1.5  static inline u64 __jiffies_to_st(unsigned long j) 
     1.6  {
     1.7 -	return processed_system_time + ((j - jiffies) * NS_PER_TICK);
     1.8 +	long delta = j - jiffies;
     1.9 +	/* NB. The next check can trigger in some wrap-around cases, but
    1.10 +	 * that's ok -- we'll just end up with a shorter timeout. */
    1.11 +	if (delta < 1)
    1.12 +		delta = 1;
    1.13 +	return processed_system_time + (delta * NS_PER_TICK);
    1.14  }
    1.15  
    1.16  /*
    1.17 @@ -683,8 +688,6 @@ int set_timeout_timer(void)
    1.18  	 * updates of jiffies since interrupts are off.
    1.19  	 */
    1.20  	j = next_timer_interrupt();
    1.21 -	if (j < (jiffies + 1))
    1.22 -		j = jiffies + 1;
    1.23  	alarm = __jiffies_to_st(j);
    1.24  
    1.25  	/* Failure is pretty bad, but we'd best soldier on. */