The patch titled Subject: rtc: refine rtc_timer_do_work() to consider other set alarm failures has been added to the -mm tree. Its filename is rtc-refine-rtc_timer_do_work-to-consider-other-set-alarm-failures.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/rtc-refine-rtc_timer_do_work-to-consider-other-set-alarm-failures.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/rtc-refine-rtc_timer_do_work-to-consider-other-set-alarm-failures.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Xunlei Pang <pang.xunlei@xxxxxxxxxx> Subject: rtc: refine rtc_timer_do_work() to consider other set alarm failures rtc_timer_do_work() only judges -ETIME failure of__rtc_set_alarm(), but doesn't handle other failures like -EIO, -EBUSY, etc. If there is a failure other than -ETIME, the next rtc_timer will stay in the timerqueue. Then later rtc_timers will be enqueued directly because they have a later expires time, so the alarm irq will never be programmed. When such failures happen, this patch will retry __rtc_set_alarm(), if still can't program the alarm time, it will remove current rtc_timer from timerqueue and fetch next one, thus preventing it from affecting other rtc timers. Signed-off-by: Xunlei Pang <pang.xunlei@xxxxxxxxxx> Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx> Cc: John Stultz <john.stultz@xxxxxxxxxx> Cc: Arnd Bergmann <arnd.bergmann@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/rtc/interface.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff -puN drivers/rtc/interface.c~rtc-refine-rtc_timer_do_work-to-consider-other-set-alarm-failures drivers/rtc/interface.c --- a/drivers/rtc/interface.c~rtc-refine-rtc_timer_do_work-to-consider-other-set-alarm-failures +++ a/drivers/rtc/interface.c @@ -899,11 +899,24 @@ again: if (next) { struct rtc_wkalrm alarm; int err; + int retry = 3; + alarm.time = rtc_ktime_to_tm(next->expires); alarm.enabled = 1; +reprogram: err = __rtc_set_alarm(rtc, &alarm); if (err == -ETIME) goto again; + else if (err) { + if (retry-- > 0) + goto reprogram; + + timer = container_of(next, struct rtc_timer, node); + timerqueue_del(&rtc->timerqueue, &timer->node); + timer->enabled = 0; + dev_err(&rtc->dev, "__rtc_set_alarm: err=%d\n", err); + goto again; + } } else rtc_alarm_disable(rtc); _ Patches currently in -mm which might be from pang.xunlei@xxxxxxxxxx are rtc-ab8500-set-uie_unsupported-flag.patch rtc-refine-rtc_timer_do_work-to-consider-other-set-alarm-failures.patch linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html