public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: dmitry.torokhov@gmail.com (Dmitry Torokhov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] PM / Domains: Power on the PM domain right after attach completes
Date: Mon, 17 Nov 2014 15:26:04 -0800	[thread overview]
Message-ID: <20141117232604.GB2049@dtor-ws> (raw)
In-Reply-To: <9731926.0Og5ZNPBtE@vostro.rjw.lan>

On Tue, Nov 18, 2014 at 12:28:26AM +0100, Rafael J. Wysocki wrote:
> On Monday, November 17, 2014 02:17:00 PM Dmitry Torokhov wrote:
> > On Mon, Nov 17, 2014 at 05:12:35PM -0500, Alan Stern wrote:
> > > On Mon, 17 Nov 2014, Dmitry Torokhov wrote:
> > > 
> > > > > >  Except buses
> > > > > > usually call pm_generic_runtime_resume() which ends up fetching driver's
> > > > > > callbacks. Maybe pm_generic_runtime_*() need be a bit smarter?
> > > > > 
> > > > > No, the bus subsystem needs to be smarter.  It shouldn't call 
> > > > > pm_generic_runtime_resume() if the driver hasn't been probed yet, or if 
> > > > > the driver has already been unbound from the device.
> > > > 
> > > > But that code wold be exactly the same for all buses, right? So why
> > > > can't pm_generic_runtime_resume() be smarter?
> > > 
> > > It would not be the same for all buses.  Each bus will have its own way 
> > > of recognizing whether or not a driver has been probed (i.e., by 
> > > checking some field in the bus-specific part of the device structure).
> > > 
> > > > However, is it allowed to call pm_runtime_get_sync() on devices that
> > > > didn't issue pm_runtime_enable()?
> > > 
> > > Yes.  But the bus has to issue pm_runtime_enable() before probing the 
> > > driver, because the driver will expect runtime PM to work properly 
> > > while its probe routine runs.  For example, the probe routine might 
> > > want to leave the device in a runtime-suspended state.  It can't do 
> > > that if the device isn't enabled for runtime PM.
> > 
> > That means that runtime PM will be enabled for all devices on given bus
> > while up till now drivers were deciding if their devices should be
> > runtime-pm-managed or not.
> 
> That's not the case for PCI drivers.
> 
> > I do not think we are quite ready for this.
> 
> We have to do that if power domains are in use, however, because if at least
> one device in a power domain in enabled for runtime PM, that will affect the
> other devices in that domain.
> 
> We could make a rule to keep a domail always up if at least one device in it
> has runtime PM disabled, but that is equivalent to enabling runtime PM for
> that device, powering the domain up and bumping up the device's usage counter.

What will driver will see if it tries to check pm_runtime_active()?
Would not it get unexpected result if the driver did not call
pm_runtime_enable() on it's device?

-- 
Dmitry

  reply	other threads:[~2014-11-17 23:26 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-17 15:19 [PATCH] PM / Domains: Power on the PM domain right after attach completes Ulf Hansson
2014-11-17 15:32 ` Russell King - ARM Linux
2014-11-17 16:54   ` Grygorii Strashko
2014-11-17 17:07     ` Russell King - ARM Linux
2014-11-17 18:28 ` Kevin Hilman
2014-11-17 19:06   ` Alan Stern
2014-11-17 19:17     ` Dmitry Torokhov
2014-11-17 19:54       ` Alan Stern
2014-11-17 20:28         ` Dmitry Torokhov
2014-11-17 20:49           ` Alan Stern
2014-11-17 21:11             ` Dmitry Torokhov
2014-11-17 21:44               ` Alan Stern
2014-11-17 22:02                 ` Dmitry Torokhov
2014-11-17 22:12                   ` Alan Stern
2014-11-17 22:17                     ` Dmitry Torokhov
2014-11-17 23:28                       ` Rafael J. Wysocki
2014-11-17 23:26                         ` Dmitry Torokhov [this message]
2014-11-18  0:26                           ` Rafael J. Wysocki
2014-11-18  2:16                             ` Rafael J. Wysocki
2014-11-18 14:05                               ` Ulf Hansson
2014-11-18 20:29                                 ` Rafael J. Wysocki
2014-11-19  8:54                                   ` Ulf Hansson
2014-11-20  0:35                                     ` Rafael J. Wysocki
2014-11-20 10:13                                       ` Ulf Hansson
2014-11-20 20:56                                         ` Rafael J. Wysocki
2014-11-20 12:17                                     ` Grygorii Strashko
2014-11-20 13:01                                       ` Ulf Hansson
2014-11-20 15:06                                         ` Grygorii Strashko
2014-11-18 16:13                       ` Alan Stern
2014-11-18 17:18                         ` Dmitry Torokhov
2014-11-18 17:44                           ` Alan Stern
2014-11-18 17:55                             ` Dmitry Torokhov
2014-11-18 20:14                               ` Rafael J. Wysocki
2014-11-18 20:04                                 ` Dmitry Torokhov
2014-11-18 21:03                                   ` Rafael J. Wysocki
2014-11-18 21:17                                     ` Rafael J. Wysocki
2014-11-18 21:02                                       ` Dmitry Torokhov
2014-11-18 21:58                                         ` Rafael J. Wysocki
2014-11-18 21:44                                           ` Dmitry Torokhov
2014-11-18 22:10                                           ` 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=20141117232604.GB2049@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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