Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "rtc: Expire alarms after the time is set."

This reverts commit 93b2ec0128c431148b216b8f7337c1a52131ef03.

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>

-6
-6
drivers/rtc/interface.c
··· 73 73 err = -EINVAL; 74 74 75 75 mutex_unlock(&rtc->ops_lock); 76 - /* A timer might have just expired */ 77 - schedule_work(&rtc->irqwork); 78 76 return err; 79 77 } 80 78 EXPORT_SYMBOL_GPL(rtc_set_time); ··· 112 114 err = -EINVAL; 113 115 114 116 mutex_unlock(&rtc->ops_lock); 115 - /* A timer might have just expired */ 116 - schedule_work(&rtc->irqwork); 117 117 118 118 return err; 119 119 } ··· 396 400 timerqueue_add(&rtc->timerqueue, &rtc->aie_timer.node); 397 401 } 398 402 mutex_unlock(&rtc->ops_lock); 399 - /* maybe that was in the past.*/ 400 - schedule_work(&rtc->irqwork); 401 403 return err; 402 404 } 403 405 EXPORT_SYMBOL_GPL(rtc_initialize_alarm);