public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Trimarchi <trimarchi@gandalf.sssup.it>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: len.brown@intel.com, linux-pm@lists.linux-foundation.org,
	Greg KH <greg@kroah.com>
Subject: Re: [RFC Add in_use attribute] Let the driver know if it's in use
Date: Thu, 23 Apr 2009 08:01:53 +0200	[thread overview]
Message-ID: <49F00451.7010004@gandalf.sssup.it> (raw)
In-Reply-To: <200904212046.45671.rjw@sisk.pl>

Hi,

Rafael J. Wysocki wrote:
> On Tuesday 21 April 2009, Michael Trimarchi wrote:
>   
>> 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.
>>>>     
>>>>         
>>> 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?
>>>
>>> Assuming it is, I'd call the flag 'in_use' rather than 'is_inuse'.  Also, if
>>> may_inuse is supposed to mean that we can set in_use for this device, I'd call
>>> it 'in_use_valid', I'd make it be unset by default and I'd allow the driver to
>>> unset it if it is going to react to 'in_use'.
>>>
>>>       
>> is_inuse is set for the device. The may_inuse is automatically setting 
>> for the child
>> device. This is done for automatically propagate the dependency
>>     
>
> I see.  I'd call it differently, then.
>
> Besides, is it really always the case that setting the flag for one device
> implies that the entire subtree below it should have the flag set?  IOW,
> there may be some devices in the subtree that we may want to suspend anyway,
> I think.
>   
There are two possible scenario here:
- propagate to the subtree for each device that its parent is in use
- leave to the user space marking the use/in_use status (i will change 
the name)

I don't see problem to write a function in userspace instead on kernel 
space.
We left the decision to suspend/not suspend to the driver. Is it correct?

So basically, just add the flag and set it in device structure and don't 
skip the
device during the suspend phase. This is can be a simple and clean solution.


Michael

  reply	other threads:[~2009-04-23  6:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-16 13:13 [RFC Add in_use attribute] Let the driver know if it's in use Michael Trimarchi
2009-04-20  9:09 ` Michael Trimarchi
2009-04-20 21:54 ` Rafael J. Wysocki
2009-04-20 22:11   ` Alan Stern
2009-04-20 22:15     ` Greg KH
2009-04-21 18:33       ` Rafael J. Wysocki
2009-04-21 21:55         ` Greg KH
2009-04-21  5:17     ` Michael Trimarchi
2009-04-21 18:30     ` Rafael J. Wysocki
2009-04-20 22:45   ` Greg KH
2009-04-21  5:08     ` Michael Trimarchi
2009-04-21  6:17       ` Greg KH
2009-04-21  6:43         ` Michael Trimarchi
2009-04-21 21:56           ` Greg KH
2009-04-23  8:47             ` Michael Trimarchi
2009-04-23 14:59               ` Rafael J. Wysocki
2009-04-23 16:49                 ` Michael Trimarchi
2009-04-23 21:41                   ` Rafael J. Wysocki
2009-04-21  5:01   ` Michael Trimarchi
2009-04-21 18:46     ` Rafael J. Wysocki
2009-04-23  6:01       ` Michael Trimarchi [this message]
2009-04-23  6:11       ` Michael Trimarchi
2009-04-23 14:56         ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49F00451.7010004@gandalf.sssup.it \
    --to=trimarchi@gandalf.sssup.it \
    --cc=greg@kroah.com \
    --cc=len.brown@intel.com \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox