From: John Stultz <johnstul@us.ibm.com>
To: Todd Poynor <toddpoynor@google.com>
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, arve@android.com
Subject: Re: [PATCH] alarmtimer: implement minimum alarm interval for allowing suspend
Date: Thu, 09 Aug 2012 14:09:18 -0700 [thread overview]
Message-ID: <502426FE.5030301@us.ibm.com> (raw)
In-Reply-To: <50242670.4020302@linaro.org>
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
next prev parent reply other threads:[~2012-08-09 21:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-09 7:37 Todd Poynor
2012-08-09 9:31 ` Rafael J. Wysocki
2012-08-09 21:06 ` John Stultz
2012-08-09 21:09 ` John Stultz [this message]
2012-08-09 21:27 ` John Stultz
2012-08-09 23:41 ` Arve Hjønnevåg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=502426FE.5030301@us.ibm.com \
--to=johnstul@us.ibm.com \
--cc=arve@android.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=toddpoynor@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome