From: John Stultz Date: Fri, 23 Mar 2012 02:14:46 +0000 (-0700) Subject: time: Avoid scary backtraces when warning of > 11% adj X-Git-Tag: accepted/tizen/common/20141203.182822~4968^2~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e919cfd42da54d400e7e0385f22cae3672dcf874;p=platform%2Fkernel%2Flinux-arm64.git time: Avoid scary backtraces when warning of > 11% adj Folks have been getting a number of warnings about time adjustments > 11%. The WARN_ON leaves a big useless backtrace so this patch removes it for a printk_once(). I'm still working to narrow down the cause of the > 11% adjustment. Signed-off-by: John Stultz --- diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index 5d76e09..16a175b 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c @@ -869,13 +869,15 @@ static void timekeeping_adjust(s64 offset) } else /* No adjustment needed */ return; - WARN_ONCE(timekeeper.clock->maxadj && - (timekeeper.mult + adj > timekeeper.clock->mult + - timekeeper.clock->maxadj), - "Adjusting %s more then 11%% (%ld vs %ld)\n", + if (unlikely(timekeeper.clock->maxadj && + (timekeeper.mult + adj > + timekeeper.clock->mult + timekeeper.clock->maxadj))) { + printk_once(KERN_WARNING + "Adjusting %s more than 11%% (%ld vs %ld)\n", timekeeper.clock->name, (long)timekeeper.mult + adj, (long)timekeeper.clock->mult + timekeeper.clock->maxadj); + } /* * So the following can be confusing. *