mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: pm list <linux-pm@lists.linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Matthew Garrett <mjg59@srcf.ucam.org>, Greg KH <greg@kroah.com>
Subject: Re: [PATCH 1/2] PM / Runtime: Add sysfs switch for disabling device run-time PM (rev. 2)
Date: Fri, 22 Jan 2010 21:56:25 +0100	[thread overview]
Message-ID: <201001222156.25529.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1001212157500.29627-100000@netrider.rowland.org>

On Friday 22 January 2010, Alan Stern wrote:
> On Thu, 21 Jan 2010, Rafael J. Wysocki wrote:
> 
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > Add new device sysfs attribute, power/control, allowing the user
> > space to block the run-time power management of devices.  If this
> > attribute is set to "on", the driver of the device won't be able to power
> > manage it at run time (without breaking the rules) and the device will
> > always be in the full power state (except when the entire system goes
> > into a sleep state).
> 
> ...
> 
> > --- linux-2.6.orig/drivers/base/power/power.h
> > +++ linux-2.6/drivers/base/power/power.h
> > @@ -2,11 +2,15 @@
> >  
> >  extern void pm_runtime_init(struct device *dev);
> >  extern void pm_runtime_remove(struct device *dev);
> > +extern void pm_runtime_allow(struct device *dev);
> > +extern void pm_runtime_forbid(struct device *dev);
> 
> Can you write a follow-up patch that moves these declarations to a
> public header file like include/linux/pm_runtime.h and EXPORTs the two
> new routines?  It is sometimes useful for drivers to be able to call
> the routines directly.

I can put them in there in this patch just as well, but I'm not sure it's the
right thing to do.

> For example, we disable runtime PM for most USB devices by default.  
> But a few drivers may know that their devices are able to handle it, so 
> they want to change the default setting when they are bound.

Runtime PM is disabled for all devices by default unless the driver enables
it.  The setting in power/control is to override the driver's choice, so that
it can be disabled even if the driver tries to enable it.

IOW, the user space is the owner of the power.runtime_auto flag and I don't
think we should allow drivers to modify it.

Rafael

  reply	other threads:[~2010-01-22 20:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-18  0:29 [RFC][PATCH] PM / Runtime: Add sysfs switch for disabling device run-time PM Rafael J. Wysocki
2010-01-18 16:10 ` Alan Stern
2010-01-18 22:25   ` [Update][RFC][PATCH] " Rafael J. Wysocki
2010-01-19 15:40     ` Alan Stern
2010-01-19 20:32       ` Rafael J. Wysocki
2010-01-19 23:27         ` Rafael J. Wysocki
2010-01-20 15:09         ` Alan Stern
2010-01-20 21:09           ` Rafael J. Wysocki
2010-01-20 21:37             ` Alan Stern
2010-01-20 22:17               ` Rafael J. Wysocki
2010-01-20  2:51 ` [RFC][PATCH] " Greg KH
2010-01-20 20:55   ` Rafael J. Wysocki
2010-01-20 22:50     ` Greg KH
2010-01-21 22:57 ` [PATCH 0/2] " Rafael J. Wysocki
2010-01-21 22:59   ` [PATCH 1/2] PM / Runtime: Add sysfs switch for disabling device run-time PM (rev. 2) Rafael J. Wysocki
2010-01-22  3:02     ` Alan Stern
2010-01-22 20:56       ` Rafael J. Wysocki [this message]
2010-01-22 22:45         ` Alan Stern
2010-01-22 22:55           ` Rafael J. Wysocki
2010-01-23  3:22         ` Alan Stern
2010-01-23 12:14           ` Rafael J. Wysocki
2010-01-23 15:20             ` Alan Stern
2010-01-23 20:08               ` Rafael J. Wysocki
2010-02-04 22:46     ` Pavel Machek
2010-02-04 23:08       ` Rafael J. Wysocki
2010-02-05  6:27         ` Pavel Machek
2010-02-05 15:19           ` Alan Stern
2010-02-05  8:03       ` [linux-pm] " Nigel Cunningham
2010-01-21 23:00   ` [PATCH 2/2] PM: Document device power attributes in sysfs Rafael J. Wysocki
2010-01-24 15:56 [PATCH 1/2] PM / Runtime: Add sysfs switch for disabling device run-time PM (rev. 2) Jesse Barnes

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=201001222156.25529.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=greg@kroah.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®