linux-kernel-test/kernel/time
Xunlei Pang 264bb3f79f time: Fix a bug in timekeeping_suspend() with no persistent clock
When there's no persistent clock, normally
timekeeping_suspend_time should always be zero, but this can
break in timekeeping_suspend().

At T1, there was a system suspend, so old_delta was assigned T1.
After some time, one time adjustment happened, and xtime got the
value of T1-dt(0s<dt<2s). Then, there comes another system
suspend soon after this adjustment, obviously we will get a
small negative delta_delta, resulting in a negative
timekeeping_suspend_time.

This is problematic, when doing timekeeping_resume() if there is
no nonstop clocksource for example, it will hit the else leg and
inject the improper sleeptime which is the wrong logic.

So, we can solve this problem by only doing delta related code
when the persistent clock is existent. Actually the code only
makes sense for persistent clock cases.

Signed-off-by: Xunlei Pang <pang.xunlei@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1427945681-29972-18-git-send-email-john.stultz@linaro.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-04-03 08:18:33 +02:00
..
alarmtimer.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
clockevents.c clockevents: Make suspend/resume calls explicit 2015-04-01 14:22:59 +02:00
clocksource.c tick: Move core only declarations and functions to core 2015-04-01 14:22:58 +02:00
hrtimer.c tick: Move core only declarations and functions to core 2015-04-01 14:22:58 +02:00
itimer.c
jiffies.c tick: Move clocksource related stuff to timekeeping.h 2015-04-01 14:22:58 +02:00
Kconfig clockevents: Remove CONFIG_GENERIC_CLOCKEVENTS_BUILD 2015-04-01 14:22:57 +02:00
Makefile clockevents: Remove CONFIG_GENERIC_CLOCKEVENTS_BUILD 2015-04-01 14:22:57 +02:00
ntp_internal.h timekeeping: Convert timekeeping core to use timespec64s 2014-07-23 10:17:54 -07:00
ntp.c time: Add y2038 safe update_persistent_clock64() 2015-04-03 08:18:20 +02:00
posix-clock.c
posix-cpu-timers.c all arches, signal: move restart_block to struct task_struct 2015-02-12 18:54:12 -08:00
posix-timers.c posix-timers: Fix stack info leak in timer_create() 2014-10-25 10:43:15 +02:00
sched_clock.c timers, sched/clock: Clean up the code a bit 2015-03-27 08:34:01 +01:00
test_udelay.c time: Rename udelay_test.c to test_udelay.c 2014-11-21 11:59:55 -08:00
tick-broadcast-hrtimer.c timers/tick/broadcast-hrtimer: Fix suspicious RCU usage in idle loop 2015-03-23 10:50:05 +01:00
tick-broadcast.c clockevents: Fix cpu_down() race for hrtimer based broadcasting 2015-04-02 14:25:39 +02:00
tick-common.c arm/bL_switcher: Kill tick suspend hackery 2015-04-01 14:23:00 +02:00
tick-internal.h tick: Further simplify tick-internal.h 2015-04-02 11:26:35 +02:00
tick-oneshot.c clockevents: Manage device's state separately for the core 2015-03-27 10:26:19 +01:00
tick-sched.c tick: Move core only declarations and functions to core 2015-04-01 14:22:58 +02:00
tick-sched.h arm/bL_switcher: Kill tick suspend hackery 2015-04-01 14:23:00 +02:00
time.c Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2015-01-25 17:47:34 -08:00
timeconst.bc
timeconv.c
timecounter.c timecounter: keep track of accumulated fractional nanoseconds 2014-12-30 18:29:27 -05:00
timekeeping_debug.c timekeeping: Convert timekeeping core to use timespec64s 2014-07-23 10:17:54 -07:00
timekeeping_internal.h clocksource: Move cycle_last validation to core code 2014-07-23 15:01:51 -07:00
timekeeping.c time: Fix a bug in timekeeping_suspend() with no persistent clock 2015-04-03 08:18:33 +02:00
timekeeping.h tick: Move clocksource related stuff to timekeeping.h 2015-04-01 14:22:58 +02:00
timer_list.c tick: Move core only declarations and functions to core 2015-04-01 14:22:58 +02:00
timer_stats.c
timer.c timer: Further simplify the SMP and HOTPLUG logic 2015-04-02 17:46:21 +02:00