Re: [PATCH] alarmtimer: implement minimum alarm interval for allowingsuspend

From: John Stultz
Date: Thu Aug 09 2012 - 17:09:36 EST


On 08/09/2012 02:06 PM, John Stultz wrote:
On 08/09/2012 12:37 AM, Todd Poynor wrote:
@@ -288,9 +293,11 @@ static int alarmtimer_suspend(struct device *dev)
now = rtc_tm_to_ktime(tm);
now = ktime_add(now, min);

- rtc_timer_start(rtc, &rtctimer, now, ktime_set(0, 0));
-
- return 0;
+ /* Set alarm, if in the past reject suspend briefly to handle */
+ ret = rtc_timer_start(rtc, &rtctimer, now, ktime_set(0, 0));
+ if (ret < 0)
+ __pm_wakeup_event(ws, 1 * MSEC_PER_SEC);
+ return ret;

What if something other then -ETIME is returned from rtc_timer_start?

Bah, sorry, too fast on the trigger there (enlightenment somehow only comes with clicking the send button).
I see the wakeup_source will expire after a second and the next suspend can try again.

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/