diff options
author | cl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk> | 2005-05-21 12:40:10 +0000 |
---|---|---|
committer | cl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk> | 2005-05-21 12:40:10 +0000 |
commit | 0f87aa7794131e2ceedab02e0a97b0c4ea0f3a53 (patch) | |
tree | ef8ea76da489dfe7300e85ca7deea442d177a548 | |
parent | 43e04538d1498ea63ab2231af1707188ef3b53e4 (diff) | |
download | xen-0f87aa7794131e2ceedab02e0a97b0c4ea0f3a53.tar.gz xen-0f87aa7794131e2ceedab02e0a97b0c4ea0f3a53.tar.bz2 xen-0f87aa7794131e2ceedab02e0a97b0c4ea0f3a53.zip |
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>
-rw-r--r-- | linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c index bf8e8f9d90..e013191f7b 100644 --- a/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c +++ b/linux-2.6.11-xen-sparse/arch/xen/i386/kernel/time.c @@ -656,7 +656,12 @@ void __init time_init(void) /* Convert jiffies to system time. Call with xtime_lock held for reading. */ static inline u64 __jiffies_to_st(unsigned long j) { - return processed_system_time + ((j - jiffies) * NS_PER_TICK); + long delta = j - jiffies; + /* NB. The next check can trigger in some wrap-around cases, but + * that's ok -- we'll just end up with a shorter timeout. */ + if (delta < 1) + delta = 1; + return processed_system_time + (delta * NS_PER_TICK); } /* @@ -683,8 +688,6 @@ int set_timeout_timer(void) * updates of jiffies since interrupts are off. */ j = next_timer_interrupt(); - if (j < (jiffies + 1)) - j = jiffies + 1; alarm = __jiffies_to_st(j); /* Failure is pretty bad, but we'd best soldier on. */ |