diff --git a/[refs] b/[refs] index 87404a22f190..3e58f65bb653 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8a8cde163ea724baf74e7752a31a69d3121a240e +refs/heads/master: bb10ed0994927d433f6dbdf274fdb26cfcf516b7 diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 4a3cb0614158..577f160131bd 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -4405,6 +4405,16 @@ do_wait_for_common(struct completion *x, long timeout, int state) spin_unlock_irq(&x->wait.lock); timeout = schedule_timeout(timeout); spin_lock_irq(&x->wait.lock); + + /* + * If the completion has arrived meanwhile + * then return 1 jiffy time left: + */ + if (x->done && !timeout) { + timeout = 1; + break; + } + if (!timeout) { __remove_wait_queue(&x->wait, &wait); return timeout;