From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Swetland Subject: Re: [RFC][PATCH 00/11] Android PM extensions Date: Fri, 30 Jan 2009 23:47:43 -0800 Message-ID: <20090131074743.GA13633@bulgaria.corp.google.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: Alan Stern Cc: Nigel Cunningham , linux-pm@lists.linux-foundation.org List-Id: linux-pm@vger.kernel.org [Alan Stern ] > > > Does the wakelock mechanism distinguish between suspend or power-state > > > transitions that happen automatically and transitions requested > > > directly by userspace? > > > > No. > > And I think this is a big mistake. It makes sense to have locks for > blocking auto suspend, but it does not make sense to prevent the user > from putting his own computer to sleep. > > For example: Suppose some program happens to hold a wakelock, perhaps > because of a simple bug, when the user closes the laptop lid and throws > the laptop into a backpack. We don't want the computer to remain awake > under those circumstances! It depends on the particular "computer" and the problem you're solving. Imagine the computer in question is a cellphone which is going to need to wake up when a call comes in to do traditional cellphone things, like ring, bring up the incall UI (so the user can answer/cancel), etc. Or perhaps it's an always-connected data device that might get remote messages (IM notifications, contacts/email sync, etc) over the network while it's "asleep" that need some processing. Bad usage of wakelocks can certainly lead to poor battery life, but there are definitely situations where you might want to operate in a mode where the user considers the device "asleep" but it may still wake up to handle certain tasks. Brian