aboutsummaryrefslogtreecommitdiff
path: root/kernel/time/clocksource.c
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2011-11-22 18:24:51 -0800
committerJohn Stultz <john.stultz@linaro.org>2011-11-22 19:25:56 -0800
commit6a8943d9ec2567572fca25cf69ad45844d0141a3 (patch)
treed14768e0747bd4b44fb00131c9c79713033c51c5 /kernel/time/clocksource.c
parentc0afabd3d553c521e003779c127143ffde55a16f (diff)
rtc: Fix some bugs that allowed accumulating time drift in suspend/resume
The current code checks if abs(delta_delta.tv_sec) is greater or equal to two before it discards the old delta value, but this can trigger at close to -1 seconds since -1.000000001 seconds is stored as tv_sec -2 and tv_nsec 999999999 in a normalized timespec. rtc_resume had an early return check if the rtc value had not changed since rtc_suspend. This effectivly stops time for the duration of the short sleep. Check if sleep_time is positive after all the adjustments have been applied instead since this allows the old_system adjustment in rtc_suspend to have an effect even for short sleep cycles. CC: stable@kernel.org Signed-off-by: Arve Hjønnevåg <arve@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'kernel/time/clocksource.c')
0 files changed, 0 insertions, 0 deletions