User: Password:
|
|
Subscribe / Log in / New account

non-racy examples, please (was Re: [PATCH 01/13] PM: Add wake lock api.)

From:  Pavel Machek <pavel-AT-ucw.cz>
To:  Arve Hj?nnev?g <arve-AT-android.com>
Subject:  non-racy examples, please (was Re: [PATCH 01/13] PM: Add wake lock api.)
Date:  Sun, 8 Feb 2009 23:17:47 +0100
Message-ID:  <20090208221747.GM6369@elf.ucw.cz>
Cc:  ncunningham-AT-crca.org.au, u.luckas-AT-road.de, swetland-AT-google.com, linux-pm-AT-lists.linux-foundation.org
Archive-link:  Article

Hi!

Ok, I think that this wakelock stuff is in "can't be used properly"
area on Rusty's scale of nasty interfaces.

So... do I understand this correctly that if I want to run "make zImage"
on Android, I'll need to modify make, gcc, .... to keep system awake?

	(How to do that? Give all the userland processes access to
	/sys/wakelocks ?)

BTW what does android do when battery goes critically low? I believe
you want to suspend, ignoring wakelocks, at that point.

And now, you have some X-like system.

	/* We were idle for too long */
	blank_screen();

	unlock_all_wakelocks();		/* We want machine to sleep */

	wait_for_key();
	/* (here) */
	lock_wakelocks("processing_key_wakelock");

...is that approximately correct? There's race there, right? If (here)
processing takes too long, or whatever, kernel will sleep the machine
before it even displays "do you want to unlock the screen" dialog,
right?

Can you solve that in a way that works, always?
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo...


(Log in to post comments)


Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds