summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang Honggang (Joseph) <eagle.rtlinux@gmail.com>2011-12-02 04:22:41 +0100
committerJohn Stultz <john.stultz@linaro.org>2011-12-02 00:50:00 +0100
commitb1f919664d04a8d0ba29cb76673c7ca3325a2006 (patch)
treeeeaafc566a9023a794eaefcda8a5201ba7ffa9bc
parentrtc: Fix some bugs that allowed accumulating time drift in suspend/resume (diff)
downloadlinux-b1f919664d04a8d0ba29cb76673c7ca3325a2006.tar.xz
linux-b1f919664d04a8d0ba29cb76673c7ca3325a2006.zip
clocksource: Fix bug with max_deferment margin calculation
In order to leave a margin of 12.5% we should >> 3 not >> 5. CC: stable@kernel.org Signed-off-by: Yang Honggang (Joseph) <eagle.rtlinux@gmail.com> [jstultz: Modified commit subject] Signed-off-by: John Stultz <john.stultz@linaro.org>
-rw-r--r--kernel/time/clocksource.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c
index cfc65e1eb9fb..da2f760e780c 100644
--- a/kernel/time/clocksource.c
+++ b/kernel/time/clocksource.c
@@ -548,7 +548,7 @@ static u64 clocksource_max_deferment(struct clocksource *cs)
* note a margin of 12.5% is used because this can be computed with
* a shift, versus say 10% which would require division.
*/
- return max_nsecs - (max_nsecs >> 5);
+ return max_nsecs - (max_nsecs >> 3);
}
#ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
@@ -669,7 +669,7 @@ void __clocksource_updatefreq_scale(struct clocksource *cs, u32 scale, u32 freq)
* ~ 0.06ppm granularity for NTP. We apply the same 12.5%
* margin as we do in clocksource_max_deferment()
*/
- sec = (cs->mask - (cs->mask >> 5));
+ sec = (cs->mask - (cs->mask >> 3));
do_div(sec, freq);
do_div(sec, scale);
if (!sec)