Suspend: RTC wakeup, sleep

Richard A. Smith richard at laptop.org
Thu Jul 29 15:58:58 EDT 2010


On 07/29/2010 04:45 AM, John Gilmore wrote:

>> My power logging scripts originally used 'sleep'.  But what I found was
>> that if the time-to-suspend was shorter than sleep then the script would
>> have cases where it would never run.
>
> Are we experiencing confusion between autosuspends and lid-close suspends?
>
> By design, autosuspends should not change the timing behavior of programs;
> the idea is for the computer to act the same, but do so using less power.

Autosuspend and lid-close suspends are identical in function.  The only 
difference is the allowed wakeup source.  The CPU is turned off.  All 
timing save the RTC (and EC [1]) is stopped.  With the RTC you have a 1 
second ambiguity and the timing precision of the EC is not suitable for 
accuracy over longer periods or temperature changes. (its RC based)

So with the system as it stands there is really no (good) way to 
accomplish a zero timing impact suspend.

>    http://book.opensourceproject.org.cn/kernel/kernel3rd/opensource/0596005652/understandlk-chp-6-sect-6.html
>
> My suspicion is that POSIX punted, i.e. the old Unix calls such as
> sleep() have undefined behavior during time warps.  "If you want
> better defined behavior, use the new POSIX calls."

gettimeofday() and friends will be subject to the 1 second RTC accuracy 
sync problem.

[1] we have some test code that stops the EC timers too. (only watchdog 
still runs) There are still some subtle issues to be sorted out though.

-- 
Richard A. Smith  <richard at laptop.org>
One Laptop per Child



More information about the Devel mailing list