From: Bart Van Assche Date: Fri, 7 Jun 2013 00:07:20 +0000 (+1000) Subject: kernel/timer.c: fix jiffies wrap behavior of round_jiffies*() X-Git-Tag: next-20130607~2^2~505 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1eb48a4c8c84a31a525102f870d7d7ca561a0daa;p=karo-tx-linux.git kernel/timer.c: fix jiffies wrap behavior of round_jiffies*() Make sure that the round_jiffies*() functions return a time that is in the future when the jiffies counter has recently wrapped. Signed-off-by: Bart Van Assche Cc: Thomas Gleixner Cc: Arjan van de Ven Cc: Stephen Rothwell Signed-off-by: Andrew Morton --- diff --git a/kernel/timer.c b/kernel/timer.c index 15ffdb3f1948..aa8b9642118b 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -149,9 +149,7 @@ static unsigned long round_jiffies_common(unsigned long j, int cpu, /* now that we have rounded, subtract the extra skew again */ j -= cpu * 3; - if (j <= jiffies) /* rounding ate our timeout entirely; */ - return original; - return j; + return time_is_after_jiffies(j) ? j : original; } /**