]> Pileus Git - ~andy/linux/commit
alarmtimer: Implement minimum alarm interval for allowing suspend
authorTodd Poynor <toddpoynor@google.com>
Thu, 9 Aug 2012 07:37:27 +0000 (00:37 -0700)
committerJohn Stultz <john.stultz@linaro.org>
Mon, 24 Sep 2012 16:38:01 +0000 (12:38 -0400)
commit59a93c27c4892f04dfd8f91f8b64d0d6eae43e6e
treefcdf1189ed72a2ffaafb4a36b8224edea0ea0f56
parentec145babe754f9ea1079034a108104b6001e001c
alarmtimer: Implement minimum alarm interval for allowing suspend

alarmtimer suspend return -EBUSY if the next alarm will fire in less
than 2 seconds.  This allows one RTC seconds tick to occur subsequent
to this check before the alarm wakeup time is set, ensuring the wakeup
time is still in the future (assuming the RTC does not tick one more
second prior to setting the alarm).

If suspend is rejected due to an imminent alarm, hold a wakeup source
for 2 seconds to process the alarm prior to reattempting suspend.

If setting the alarm incurs an -ETIME for an alarm set in the past,
or any other problem setting the alarm, abort suspend and hold a
wakelock for 1 second while the alarm is allowed to be serviced or
other hopefully transient conditions preventing the alarm clear up.

Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
kernel/time/alarmtimer.c