Skip to content

Commit f423fc6

Browse files
committed
Revert "rtc: Expire alarms after the time is set."
This reverts commit 93b2ec0. The call to "schedule_work()" in rtc_initialize_alarm() happens too early, and can cause oopses at bootup Neil Brown explains why we do it: "If you set an alarm in the future, then shutdown and boot again after that time, then you will end up with a timer_queue node which is in the past. When this happens the queue gets stuck. That entry-in-the-past won't get removed until and interrupt happens and an interrupt won't happen because the RTC only triggers an interrupt when the alarm is "now". So you'll find that e.g. "hwclock" will always tell you that 'select' timed out. So we force the interrupt work to happen at the start just in case." and has a patch that convert it to do things in-process rather than with the worker thread, but right now it's too late to play around with this, so we just revert the patch that caused problems for now. Reported-by: Sander Eikelenboom <linux@eikelenboom.it> Requested-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Requested-by: John Stultz <john.stultz@linaro.org> Cc: Neil Brown <neilb@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 157e8bf commit f423fc6

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/rtc/interface.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ int rtc_set_time(struct rtc_device *rtc, struct rtc_time *tm)
7373
err = -EINVAL;
7474

7575
mutex_unlock(&rtc->ops_lock);
76-
/* A timer might have just expired */
77-
schedule_work(&rtc->irqwork);
7876
return err;
7977
}
8078
EXPORT_SYMBOL_GPL(rtc_set_time);
@@ -114,8 +112,6 @@ int rtc_set_mmss(struct rtc_device *rtc, unsigned long secs)
114112
err = -EINVAL;
115113

116114
mutex_unlock(&rtc->ops_lock);
117-
/* A timer might have just expired */
118-
schedule_work(&rtc->irqwork);
119115

120116
return err;
121117
}
@@ -400,8 +396,6 @@ int rtc_initialize_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm)
400396
timerqueue_add(&rtc->timerqueue, &rtc->aie_timer.node);
401397
}
402398
mutex_unlock(&rtc->ops_lock);
403-
/* maybe that was in the past.*/
404-
schedule_work(&rtc->irqwork);
405399
return err;
406400
}
407401
EXPORT_SYMBOL_GPL(rtc_initialize_alarm);

0 commit comments

Comments
 (0)