aboutsummaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
authorack@localhost.localdomain <ack@localhost.localdomain>2006-06-28 21:51:01 +0100
committerack@localhost.localdomain <ack@localhost.localdomain>2006-06-28 21:51:01 +0100
commitaf183516f37f2485e7447905f032e7133c162568 (patch)
treeaa62fc922d52903ebc8551384a5bc4ef8120a8a7 /patches
parentb9c06364b42bade2ab26b7f1b552f00a9f6ad15e (diff)
downloadxen-af183516f37f2485e7447905f032e7133c162568.tar.gz
xen-af183516f37f2485e7447905f032e7133c162568.tar.bz2
xen-af183516f37f2485e7447905f032e7133c162568.zip
Fix next_timer_interrupt() in patch and update caller
to deal with the case of existing pending timers. Fixes a dom0 hang at boot time on some HPs where some dubious USB code is invoked from pci_init() that potentially calls msleep(10) a few times. Signed-off-by: Emmanuel Ackaouy <ack@xensource.com>
Diffstat (limited to 'patches')
-rw-r--r--patches/linux-2.6.16.13/fix-hz-suspend.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/patches/linux-2.6.16.13/fix-hz-suspend.patch b/patches/linux-2.6.16.13/fix-hz-suspend.patch
new file mode 100644
index 0000000000..a90c30816a
--- /dev/null
+++ b/patches/linux-2.6.16.13/fix-hz-suspend.patch
@@ -0,0 +1,22 @@
+diff -pruN ../pristine-linux-2.6.16.13/kernel/timer.c ./kernel/timer.c
+--- ../pristine-linux-2.6.16.13/kernel/timer.c 2006-05-02 14:38:44.000000000 -0700
++++ ./kernel/timer.c 2006-06-28 09:57:51.000000000 -0700
+@@ -555,7 +555,17 @@ found:
+ }
+ spin_unlock(&base->t_base.lock);
+
+- if (time_before(hr_expires, expires))
++ /*
++ * If timers are pending, "expires" will be in the recent past
++ * of "jiffies". If there are no hr_timers registered, "hr_expires"
++ * will be "jiffies + MAX_JIFFY_OFFSET"; this is *just* short of being
++ * considered to be before "jiffies". This makes it very likely that
++ * "hr_expires" *will* be considered to be before "expires".
++ * So we must check when there are pending timers (expires <= jiffies)
++ * to ensure that we don't accidently tell the caller that there is
++ * nothing scheduled until half an epoch (MAX_JIFFY_OFFSET)!
++ */
++ if (time_before(jiffies, expires) && time_before(hr_expires, expires))
+ return hr_expires;
+
+ return expires;