aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2004-10-24 03:36:12 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-10-24 03:36:12 -0700
commitc259ef842622a5e64418d9dab3b62ee051867edf (patch)
treee74387fd8febb182dc59769aa3cb7ec1369a789a /kernel
parent23493c984cf8a28d653aa9c4457eb2ee8298d873 (diff)
downloadhistory-c259ef842622a5e64418d9dab3b62ee051867edf.tar.gz
[PATCH] Fix msleep to sleep _at_least_ the requested amount
Makes sure msleep() sleeps at least the amount provided, since schedule_timeout() doesn't guarantee a full jiffy. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/timer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index ac9386e22bd332..265d4dc856f0ee 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -1605,7 +1605,7 @@ unregister_time_interpolator(struct time_interpolator *ti)
*/
void msleep(unsigned int msecs)
{
- unsigned long timeout = msecs_to_jiffies(msecs);
+ unsigned long timeout = msecs_to_jiffies(msecs) + 1;
while (timeout) {
set_current_state(TASK_UNINTERRUPTIBLE);
@@ -1621,7 +1621,7 @@ EXPORT_SYMBOL(msleep);
*/
unsigned long msleep_interruptible(unsigned int msecs)
{
- unsigned long timeout = msecs_to_jiffies(msecs);
+ unsigned long timeout = msecs_to_jiffies(msecs) + 1;
while (timeout && !signal_pending(current)) {
set_current_state(TASK_INTERRUPTIBLE);