From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761926AbZBRWsX (ORCPT ); Wed, 18 Feb 2009 17:48:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757970AbZBRWf3 (ORCPT ); Wed, 18 Feb 2009 17:35:29 -0500 Received: from yx-out-2324.google.com ([74.125.44.30]:19106 "EHLO yx-out-2324.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757580AbZBRWf2 convert rfc822-to-8bit (ORCPT ); Wed, 18 Feb 2009 17:35:28 -0500 MIME-Version: 1.0 In-Reply-To: <200902182217.48321.rjw@sisk.pl> References: <200902180022.00239.rjw@sisk.pl> <200902182217.48321.rjw@sisk.pl> Date: Wed, 18 Feb 2009 14:35:26 -0800 Message-ID: Subject: Re: [RFD] Automatic suspend From: =?ISO-8859-1?Q?Arve_Hj=F8nnev=E5g?= To: "Rafael J. Wysocki" Cc: Alan Stern , "Woodruff, Richard" , Arjan van de Ven , Kyle Moffett , Oliver Neukum , Benjamin Herrenschmidt , pm list , LKML , Pavel Machek , Nigel Cunningham , Matthew Garrett , mark gross , Uli Luckas , Igor Stoppa , Brian Swetland , Len Brown Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 18, 2009 at 1:17 PM, Rafael J. Wysocki wrote: > On Wednesday 18 February 2009, Arve Hjønnevåg wrote: >> On Tue, Feb 17, 2009 at 3:21 PM, Rafael J. Wysocki wrote: >> > On Tuesday 17 February 2009, Alan Stern wrote: >> >> Kernel wakelocks are a separate matter. They are more like a form of >> >> optimization, preventing the kernel from starting an auto-suspend when >> >> some driver knows beforehand that it will return -EBUSY. >> > >> > I think kernel-side autosuspend (or rather autosleep) should only happen >> > after certain subset of devices have been suspended using a per-device >> > run-time autosuspend mechanism. >> >> When the last wakelock is released the task that we woke up to perform >> has finished. Why wait to re-enter suspend. > > I don't really understand this comment. Could you please explain a bit? If some devices are autosuspended after a local inactivity timeout, I don't want to wait for those devices to autosuspend if I know the code that needed to run is done. This could cause delays in the normal case, and it could prevent suspend if a background process (not using wakelocks) is accessing a disk more frequently than its idle timeout. > >> >> > Phase 3: Probably explicit control left to open/close. >> >> >> >> While that's generally a good idea, it's important to recognize that >> >> some devices should be runtime-suspended even while they are open. >> > >> > From the kernel side, yes (and that should be transparent to the user space >> > having them open). By the user space, no. >> >> Allowing user space to suspend input devices while they are still open >> is useful. The user-space code that reads from the input devices does >> not need to know if the device is suspended or not, and the kernel >> cannot auto suspend input devices based on inactivity. > > Hmm. Why can't it? Because they stop working. It is OK for us to turn off the touchscreen when the screen is off, but when the screen is on the user will touch items on the screen and expect them to respond. (We could also turn off the touchscreen when the keyguard is on, but we don't currently do this.) -- Arve Hjønnevåg