From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760243AbZB0U6m (ORCPT ); Fri, 27 Feb 2009 15:58:42 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757016AbZB0U6d (ORCPT ); Fri, 27 Feb 2009 15:58:33 -0500 Received: from ogre.sisk.pl ([217.79.144.158]:45746 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755080AbZB0U6c (ORCPT ); Fri, 27 Feb 2009 15:58:32 -0500 From: "Rafael J. Wysocki" To: Alan Stern Subject: Re: [RFD] Automatic suspend Date: Fri, 27 Feb 2009 21:58:29 +0100 User-Agent: KMail/1.11.0 (Linux/2.6.29-rc5-tst; KDE/4.2.0; x86_64; ; ) Cc: Pavel Machek , Oliver Neukum , "Arve Hj?nnev?g" , "Woodruff, Richard" , Arjan van de Ven , Kyle Moffett , Benjamin Herrenschmidt , pm list , LKML , Nigel Cunningham , Matthew Garrett , mark gross , Uli Luckas , Igor Stoppa , Brian Swetland , Len Brown References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200902272158.31784.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 27 February 2009, Alan Stern wrote: > On Fri, 27 Feb 2009, Pavel Machek wrote: > > > > > > To summarize, we can: > > > * Use a refcount such that automatic suspend will only be possible if it's > > > equal to zero (but that need not be the only criterion). > > > * Use a per-device flag in dev_pm_info that will be set whenever the device > > > driver increases the refcount and unset whenever the driver decreases the > > > refcount. > > > * Use a per-process flag that will be set whenever the process increases the > > > refcount and unset whenever the process decreases the refcount. > > > > Yes, that sounds sane, and that's how reasonable wakelock > > implementation should look like. > > One small point: If you add a per-device flag and a per-process flag as > described above, then drivers and processes must not acquire nested > references. > > Obviously this is fixable, but it's worth mentioning... Yes, it's important to remeber IMO. Thanks, Rafael