Re: [RFC PATCH] rtc: keep system awake until all expired RTC timersare handled

From: John Stultz
Date: Thu Jul 18 2013 - 16:04:00 EST


On 06/26/2013 04:09 PM, Zoran Markovic wrote:
Current implementation of RTC interface allows for system suspend to
occur in the following cases:
(a) if a timer is set in the past and rtc_timer_do_work() is scheduled
to handle it, and
(b) if rtc_timer_do_work() is called to handle expired timers whose
handlers implement a preemption point.

A pending suspend request may be honoured in the above cases causing
timer handling to be delayed until after the next resume. This is
undesirable since timer handlers may have time-critical code to execute.

This patch makes sure that the system stays awake until all expired
timers are handled.

Note that all calls to pm_stay_awake() are eventually paired with
the single pm_relax() call in rtc_timer_do_work(), which is launched
using schedule_work().

Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Cc: John Stultz <john.stultz@xxxxxxxxxx>
Cc: Arve Hjonnevag <arve@xxxxxxxxxxx>
Cc: Todd Poynor <toddpoynor@xxxxxxxxxx>
Signed-off-by: Zoran Markovic <zoran.markovic@xxxxxxxxxx>

Haven't seen any objections here, so I'll queue this for 3.12.

thanks
-john

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/