kernel-fxtec-pro1x/kernel/time
John Stultz 830ec0458c time: Fix accumulation bug triggered by long delay.
The logarithmic accumulation done in the timekeeping has some overflow
protection that limits the max shift value. That means it will take
more then shift loops to accumulate all of the cycles. This causes
the shift decrement to underflow, which causes the loop to never exit.

The simplest fix would be simply to do a:
	if (shift)
		shift--;

However that is not optimal, as we know the cycle offset is larger
then the interval << shift, the above would make shift drop to zero,
then we would be spinning for quite awhile accumulating at interval
chunks at a time.

Instead, this patch only decreases shift if the offset is smaller
then cycle_interval << shift.  This makes sure we accumulate using
the largest chunks possible without overflowing tick_length, and limits
the number of iterations through the loop.

This issue was found and reported by Sonic Zhang, who also tested the fix.
Many thanks your explanation and testing!

Reported-by: Sonic Zhang <sonic.adi@gmail.com>
Signed-off-by: John Stultz <johnstul@us.ibm.com>
Tested-by: Sonic Zhang <sonic.adi@gmail.com>
LKML-Reference: <1268948850-5225-1-git-send-email-johnstul@us.ibm.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2010-03-23 16:41:01 +01:00
..
clockevents.c
clocksource.c timekeeping: Prevent oops when GENERIC_TIME=n 2010-03-02 09:22:25 +01:00
jiffies.c
Kconfig
Makefile
ntp.c
tick-broadcast.c
tick-common.c
tick-internal.h
tick-oneshot.c clockevents: Sanitize min_delta_ns adjustment and prevent overflows 2010-03-12 19:10:29 +01:00
tick-sched.c
timecompare.c
timeconv.c
timekeeping.c time: Fix accumulation bug triggered by long delay. 2010-03-23 16:41:01 +01:00
timer_list.c clockevents: Sanitize min_delta_ns adjustment and prevent overflows 2010-03-12 19:10:29 +01:00
timer_stats.c