Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: clockevents: Set noop handler in clockevents_exchange_device() tick-broadcast: Stop active broadcast device when replacing it clocksource: Fix bug with max_deferment margin calculation rtc: Fix some bugs that allowed accumulating time drift in suspend/resume rtc: Disable the alarm in the hardware
This commit is contained in:
@@ -63,7 +63,7 @@ static int rtc_suspend(struct device *dev, pm_message_t mesg)
|
||||
*/
|
||||
delta = timespec_sub(old_system, old_rtc);
|
||||
delta_delta = timespec_sub(delta, old_delta);
|
||||
if (abs(delta_delta.tv_sec) >= 2) {
|
||||
if (delta_delta.tv_sec < -2 || delta_delta.tv_sec >= 2) {
|
||||
/*
|
||||
* if delta_delta is too large, assume time correction
|
||||
* has occured and set old_delta to the current delta.
|
||||
@@ -97,9 +97,8 @@ static int rtc_resume(struct device *dev)
|
||||
rtc_tm_to_time(&tm, &new_rtc.tv_sec);
|
||||
new_rtc.tv_nsec = 0;
|
||||
|
||||
if (new_rtc.tv_sec <= old_rtc.tv_sec) {
|
||||
if (new_rtc.tv_sec < old_rtc.tv_sec)
|
||||
pr_debug("%s: time travel!\n", dev_name(&rtc->dev));
|
||||
if (new_rtc.tv_sec < old_rtc.tv_sec) {
|
||||
pr_debug("%s: time travel!\n", dev_name(&rtc->dev));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -116,7 +115,8 @@ static int rtc_resume(struct device *dev)
|
||||
sleep_time = timespec_sub(sleep_time,
|
||||
timespec_sub(new_system, old_system));
|
||||
|
||||
timekeeping_inject_sleeptime(&sleep_time);
|
||||
if (sleep_time.tv_sec >= 0)
|
||||
timekeeping_inject_sleeptime(&sleep_time);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user