suspend/resume issues still unsolved

587 views
Skip to first unread message

Ben Dooks

unread,
May 10, 2011, 6:11:00 AM5/10/11
to android-porting
I've returned to looking at the resume issue with our current
Android port (generic build of 2.3.2, with a 2.6.37 android
kernel with support added for our board).

The problem is, as previously stated that the system immediately
shuts itself back down when you hit a resume source. We have fixed
this by adding a patch to the resume path to do the following:

--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -248,6 +248,9 @@ int suspend_devices_and_enter(suspend_state_t state)
*/
static void suspend_finish(void)
{
+#ifdef CONFIG_EARLYSUSPEND
+ request_suspend_state(PM_SUSPEND_ON);
+#endif
suspend_thaw_processes();
usermodehelper_enable();
pm_notifier_call_chain(PM_POST_SUSPEND);

To ensure that the main android power driver does not decide that it
needs to suspend again, and re-run the suspend process.

I've checked through the android source tree, and it seems the only
two places where /sys/power/state is referenced is in the powerd sources
(system/core/toolbox/powerd.c) and the init.rc.

The powerd source does not seem to be built into the toolbox, and
there's no mention in my build. Is this some form of problem known
to the "generic" build?

I've tried changing one of my resume buttons to send the POWER key
to see if this is required, but it does not make any difference to
the result.

The init.rc script has a service statement which should also make
sure that the power state is set, but it does not seem to be executed.

> service zygote /system/bin/app_process -Xzygote /system/bin --zygote --start-system-server
> socket zygote stream 666
> onrestart write /sys/android_power/request_state wake
> onrestart write /sys/power/state on
> onrestart restart media
> onrestart restart netd


See:
http://groups.google.com/group/android-porting/browse_thread/thread/13d665ee8fc006c0/


--
Ben Dooks <bjd...@googlemail.com> http://www.fluff.org/ben/

Reply all
Reply to author
Forward
0 new messages