[maemo-developers] RFC: n800 suspend to ram

From: Igor Stoppa igor.stoppa at nokia.com
Date: Wed Mar 7 13:56:18 EET 2007
On Wed, 2007-03-07 at 05:01 -0600, ext Mike Baker wrote:
> Hi; I've been doing some experiments with powersave on the n800.
Good, that's really good news.

> It seems you can't just put the n800 into suspend mode simply by doing a
> "echo mem > /sys/power/state", the retu watchdog kicks in if you leave it
> in that state too long. There is a flasher command to disable the retu
> watchdog, although through some horrible mistranslation it only stops the
> system from refreshing the watchdog -- it still goes off and brings down the
> system. Luckily there's an alternative, messy as it is -
The wd in retu is a deadman's button. It comes from phones legacy, where a
rebooting device can disrupt communications for others as well. In the tablet
it still makes sense to have it for avoiding that if the devices becomes stuck,
it also drains your battery.

> Refresh the retu watchdog, this will give you 64 seconds until it needs to
> be refreshed again. Next, set the retu rtc alarm; you only get one minute
> resolution, but that's jsut enough. Once the alarm is set, suspend; the
> alarm will wake the device out of suspend mode and the cycle repeats.
Theoretically it's good; practically, i'm not so sure.
The reason being that with runtime power management we get away quite
cleanly with drivers not having to save/restore their state (we only ask
them to use the clock fw).

You probably would use suspend as an alternative to long idle periods,
such as overnight, maybe using an idle timer to detect it.

However, because of the 64s constraint, the energy price is not little
when doing the wd kicking from userspace. A more power efficient
solution (at the expense of stability) would be to do it from
kernelspace, _whitout_ triggering the whole system thaw and re-enabling
only those drivers required to talk with retu (since it contains both
the rtc and the wd).

But that's a very custom hack.

> Attached is a script to suspend the n800, the script is designed to run in
> the background and take advantage of the softoff state. (If you haven't done
> so already, I'd suggest editing /etc/mce/mce.ini and setting the power button
> to softoff). Once the softoff state is detected, the script will attempt to
> force the device into suspend.
> The script will spit out debug messages as it's run -
> "wait"
>    the script is waiting for a softoff (backlight off, touch disabled)
>    it will poll the system in 10 second intervals
> "refresh"
>    updating the retu watchdog
> "sleep XX"
>    suspending until rtc alarm in XX seconds
> "awake (asleep X:XX:XX)"
>    device came back from sleep state before the alarm; likely the result
>    of user interaction. X:XX:XX represents the total amount of time the 
>    script -attempted- to sleep for.
> Caveats -
> - the script must be run as root and should be run locally (not via ssh)
> - the device doesn't always suspend; particularly when the charger is attached
> - loadavg after exiting suspend is extremely high; probably miscalculated
> - the dsp REALLY hates it when you suspend with dsp activity
yeah, that too

> There doesn't seem to be a good way of suspending dsp activity; I've read
> through the dsp documentation (http://dspgateway.sf.net) which seems to
> suggest the 'dspctl suspend' and 'dspctl resume' commands, which don't work.
> Once the dsp has crashed I can't find a reliable way to even restart it
> without rebooting.
> Requested -
> - completely disabling the watchdogs
I'm not sure that will ever be an option, with the device having radios.
> - help with dspctl/dsp_dld system
> The latest version of the script can always be found at
> http://mbm.openwrt.org/n800/suspend.sh

Never the less, congratulations for the effort.
> _______________________________________________
> maemo-developers mailing list
> maemo-developers at maemo.org
> https://maemo.org/mailman/listinfo/maemo-developers
Cheers, Igor

Igor Stoppa <igor.stoppa at nokia.com>
(Nokia M - OSSO /Helsinki Finland)

More information about the maemo-developers mailing list