All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Matthew Garrett <mjg59@srcf.ucam.org>,
	linux-usb@vger.kernel.org, linux-pci@vger.kernel.org,
	Greg KH <gregkh@suse.de>, LKML <linux-kernel@vger.kernel.org>,
	"Linux-pm mailing list" <linux-pm@lists.linux-foundation.org>
Subject: Re: [linux-pm] [RFC] PCI: Runtime power management
Date: Fri, 14 Aug 2009 22:05:19 +0200	[thread overview]
Message-ID: <200908142205.20093.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0908141032070.2987-100000@iolanthe.rowland.org>

On Friday 14 August 2009, Alan Stern wrote:
> On Thu, 13 Aug 2009, Matthew Garrett wrote:
> 
> > On Thu, Aug 13, 2009 at 11:22:44AM -0400, Alan Stern wrote:
> >
> > > You have to call the HCD's pci_suspend method!  Not to mention calling
> > > synchronize_irq and all the other stuff in hcd_pci_suspend and
> > > hcd_pci_suspend_noirq.
> >
> > The bus level code does this, assuming that the driver-level code
> > doesn't return an error.
> 
> So it does; my mistake.
> 
> 
> On Fri, 14 Aug 2009, Matthew Garrett wrote:
> 
> > On Thu, Aug 13, 2009 at 10:47:01PM +0100, Matthew Garrett wrote:
> > 
> > > Ugh. I'd really prefer us to assume that drivers are able to cope unless 
> > > proven otherwise. Userspace policy makes sense where we don't have any 
> > > idea whether something will work or not, but I'd really expect that most 
> > > PCI drivers will either cope (in which case they'll have enabling code) 
> > > or won't (in which case they won't). Why would we want userspace to 
> > > influence this?
> > 
> > Though, thinking about it, you're right that setting this does override 
> > user policy. I think we need an additional flag to indicate that the 
> > device supports runtime wakeup and test that as well when doing 
> > device_may_wakeup().
> 
> You are suggesting separate flag sets for system-wide wakeup and
> runtime wakeup?  I don't disagree, but implementing them will be
> problematical.
> 
> That's because it's not always possible to change a device's wakeup 
> setting while it is suspended.  Thus if a device was runtime suspended 
> with wakeup enabled, and then we want to do a system sleep and change 
> the device's wakeup setting to disabled, we would have to wake the 
> device back up in order to do it.

Well, sometimes the user may want a device to be power managed at run time
and not to be able to wake up the system from sleep states.  For example,
I'd like the USB controller in my box to be suspended at run time whenever it's
not used, but surely I wouldn't like it to do system-wide wakeup, because it
does that when I move the mouse which is a cordless one.  Simply turning the
mouse on causes the system to wake up. :-)

So, I don't think we have a choice here.  If the user forbids the device to
wake up the system from sleep states, we have to do what he wants, even if
that means the devices has to be resumed before putting the system into a
sleep state.

Why don't we add a flag indicating whether or not the device is allowed to
be power managed at run time, something like runtime_forbidden, that the
user space will be able to set through sysfs?

If the user space does that, we can't power manage the device at run time,
so it can't do runtime wakeup as well.  Otherwise, the device is power
manageable at run time, which implies runtime wakeup if supported.

Thanks,
Rafael

  parent reply	other threads:[~2009-08-14 20:04 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-08 14:25 [PATCH] PM: Introduce core framework for run-time PM of I/O devices (rev. 14) Rafael J. Wysocki
2009-08-09 21:13 ` [PATCH update] PM: Introduce core framework for run-time PM of I/O devices (rev. 15) Rafael J. Wysocki
2009-08-09 21:13 ` Rafael J. Wysocki
2009-08-12 10:37   ` Magnus Damm
2009-08-12 15:47     ` Alan Stern
2009-08-12 15:47     ` Alan Stern
2009-08-12 20:13     ` Rafael J. Wysocki
2009-08-12 20:13     ` Rafael J. Wysocki
2009-08-12 10:37   ` Magnus Damm
2009-08-13  0:29   ` [RFC] PCI: Runtime power management Matthew Garrett
2009-08-13  0:29   ` Matthew Garrett
2009-08-13  0:35     ` [RFC] usb: Add support for runtime power management of the hcd Matthew Garrett
2009-08-13 12:16       ` Oliver Neukum
2009-08-13 12:16       ` [linux-pm] " Oliver Neukum
2009-08-13 12:30         ` Matthew Garrett
2009-08-13 12:30         ` [linux-pm] " Matthew Garrett
2009-08-13 14:26           ` Oliver Neukum
2009-08-13 14:26           ` [linux-pm] " Oliver Neukum
2009-08-13 21:42             ` Matthew Garrett
2009-08-13 21:42             ` Matthew Garrett
2009-08-13 15:22       ` Alan Stern
2009-08-13 15:22       ` Alan Stern
2009-08-13 21:47         ` Matthew Garrett
2009-08-13 21:47         ` Matthew Garrett
2009-08-13  0:35     ` Matthew Garrett
2009-08-13 15:17     ` [RFC] PCI: Runtime power management Alan Stern
2009-08-13 21:47       ` Matthew Garrett
2009-08-14 12:30         ` Matthew Garrett
2009-08-14 12:30         ` [linux-pm] " Matthew Garrett
2009-08-14 14:43           ` Alan Stern
2009-08-14 14:43           ` [linux-pm] " Alan Stern
2009-08-14 17:05             ` Rafael J. Wysocki
2009-08-14 17:05             ` [linux-pm] " Rafael J. Wysocki
2009-08-14 17:13               ` Rafael J. Wysocki
2009-08-14 17:13               ` [linux-pm] " Rafael J. Wysocki
2009-08-14 19:01                 ` Alan Stern
2009-08-14 19:01                 ` Alan Stern
2009-08-14 20:05             ` Rafael J. Wysocki [this message]
2009-08-14 22:21               ` [linux-pm] " Matthew Garrett
2009-08-15 14:18                 ` Rafael J. Wysocki
2009-08-15 14:18                 ` [linux-pm] " Rafael J. Wysocki
2009-08-15 15:53                   ` Alan Stern
2009-08-15 15:53                   ` [linux-pm] " Alan Stern
2009-08-15 20:54                     ` Rafael J. Wysocki
2009-08-15 20:54                     ` [linux-pm] " Rafael J. Wysocki
2009-08-15 20:58                       ` Matthew Garrett
2009-08-15 20:58                       ` [linux-pm] " Matthew Garrett
2009-08-15 21:21                         ` Rafael J. Wysocki
2009-08-15 21:21                           ` Rafael J. Wysocki
2009-08-15 21:27                           ` [linux-pm] " Matthew Garrett
2009-08-15 21:44                             ` Rafael J. Wysocki
2009-08-15 21:44                             ` [linux-pm] " Rafael J. Wysocki
2009-08-16 16:09                               ` Alan Stern
2009-08-16 16:09                               ` Alan Stern
2009-08-15 21:27                           ` Matthew Garrett
2009-08-16 15:57                           ` Alan Stern
2009-08-16 15:57                           ` [linux-pm] " Alan Stern
2009-08-16 16:04                             ` Matthew Garrett
2009-08-16 16:04                             ` [linux-pm] " Matthew Garrett
2009-08-16 15:50                       ` Alan Stern
2009-08-16 15:50                       ` [linux-pm] " Alan Stern
2009-08-14 22:21               ` Matthew Garrett
2009-08-14 20:05             ` Rafael J. Wysocki
2009-08-13 21:47       ` Matthew Garrett
2009-08-13 15:17     ` Alan Stern
2009-08-14 17:37     ` Jesse Barnes
2009-08-14 17:37     ` Jesse Barnes
2009-08-14 19:15       ` Rafael J. Wysocki
2009-08-14 19:15       ` Rafael J. Wysocki
2009-08-14 21:22     ` Rafael J. Wysocki
2009-08-14 22:30       ` Matthew Garrett
2009-08-14 22:30       ` Matthew Garrett
2009-08-15 14:41         ` Rafael J. Wysocki
2009-08-15 15:24           ` Rafael J. Wysocki
2009-08-15 15:24           ` Rafael J. Wysocki
2009-08-15 14:41         ` Rafael J. Wysocki
2009-08-14 21:22     ` Rafael J. Wysocki
2009-08-13 20:56   ` [PATCH update 2x] PM: Introduce core framework for run-time PM of I/O devices (rev. 16) Rafael J. Wysocki
2009-08-13 21:03     ` Paul Mundt
2009-08-13 21:03     ` Paul Mundt
2009-08-13 21:14       ` Rafael J. Wysocki
2009-08-13 21:14       ` Rafael J. Wysocki
2009-08-14  9:08     ` Magnus Damm
2009-08-14 17:19       ` Rafael J. Wysocki
2009-08-14 17:19       ` Rafael J. Wysocki
2009-08-14  9:08     ` Magnus Damm
2009-08-14 17:25     ` [PATCH update 3x] PM: Introduce core framework for run-time PM of I/O devices (rev. 17) Rafael J. Wysocki
2009-08-14 17:25     ` Rafael J. Wysocki
2009-08-13 20:56   ` [PATCH update 2x] PM: Introduce core framework for run-time PM of I/O devices (rev. 16) 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=200908142205.20093.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.