From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: [RFC Add in_use attribute] Let the driver know if it's in use Date: Tue, 21 Apr 2009 20:33:01 +0200 Message-ID: <200904212033.02035.rjw@sisk.pl> References: <200904202354.04777.rjw@sisk.pl> <20090420221518.GA28499@kroah.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090420221518.GA28499@kroah.com> Content-Disposition: inline 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: Greg KH Cc: len.brown@intel.com, linux-pm@lists.linux-foundation.org, pavel@suse.cz List-Id: linux-pm@vger.kernel.org On Tuesday 21 April 2009, Greg KH wrote: > > I seem to not have seen the original post about this, thanks Alan for > adding me to the cc: > > On Mon, Apr 20, 2009 at 06:11:18PM -0400, Alan Stern wrote: > > On Mon, 20 Apr 2009, Rafael J. Wysocki wrote: > > > > > On Thursday 16 April 2009, Michael Trimarchi wrote: > > > > Drivers on embedded systems would be smart enough > > > > to know that some of the devices should remain powered up, because > > > > they could still be useful even when the CPU wasn't running. > > > > The patch add the in_use attribute, that it can be used by the > > > > the drivers to avoid power down during suspend. > > I'm confused, why would a driver not know if it was in use or not? > Actually, how would it not know already by virtue of what is happening > within it (io in flight, buttons being pushed, dma streaming, etc.)? > > > > OK, so the idea is that in_use will be set by the user space for devices that > > > shouldn't be suspended. Is this correct? > > So userspace knows better than the kernel as to if a specific driver is > being used at the moment? Why is this so? The name of the flag is not the best one. :-) The flag is supposed to mean "don't suspend this device during system-wide suspend, because it's being used for something you may be unaware of". AFAICS. Best, Rafael