public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>,
	Magnus Damm <magnus.damm@gmail.com>,
	linux-pm@lists.linux-foundation.org,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>,
	Greg KH <gregkh@suse.de>
Subject: Re: [patch update 3] PM: Introduce core framework for run-time PM of I/O devices
Date: Wed, 24 Jun 2009 02:17:38 +0200	[thread overview]
Message-ID: <200906240217.39608.rjw@sisk.pl> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0906231408370.3209-100000@iolanthe.rowland.org>

On Tuesday 23 June 2009, Alan Stern wrote:
> On Tue, 23 Jun 2009, Rafael J. Wysocki wrote:
> 
> > In short, I think suspending (or queuing a suspend request) should fail if the
> > usage counter is nonzero, but the resuming (or queuing up a resume request)
> > should be possible regardless of its value.  The reason is that multiple
> > threads may in theory attempt to resume the device at the same time.
> 
> Agreed.  Suspends and resumes aren't symmetrical -- a single resume 
> request must outweigh numerous suspend requests.
> 
> > However, I'm not sure if the core should manipulate the usage counter by
> > itself, because it's sort of problematic (there's no good approach to decide
> > when to decrement the counter).
> 
> Yes.  The idea behind my previous message was that it's not really so
> easy for the core to decide when to _increment_ the counter either.
> 
> > So, I'd let the callers use pm_runtime_get() to increment the counter
> > and pm_runtime_put() to decrement it, possibly queuing up an idle notification
> > if the counter happens to reach 0.  Also, I'm not sure if unbalanced
> > pm_runtime_put() should be regarded as a bug.
> 
> It should be.  Once the counter is messed up, runtime PM wouldn't be
> able to work properly.  But maybe you should add a pm_set_counter call
> so that drivers can recover from imbalances.
> 
> One question still remains: If the counter is 0 at the end of a
> successful pm_runtime_resume, should the core then call pm_notify_idle?  
> Or should we make the driver responsible for that too?

Good question. :-)

I think the core may call pm_notify_idle() in that case, but not necessarily in
the synchronous case.

> > At the same time, I'd like the core to use runtime_status and the other
> > fields in dev_pm_info, except for the usage counter, to ensure that all
> > operations are only carried out when it makes sense.
> 
> Yes.  In fact, I'd say that when the counter is positive it doesn't
> make sense to allow a runtime suspend -- so you don't need that
> exception in your statement above.  :-)

Well, you're right.

Best,
Rafael

  reply	other threads:[~2009-06-24  0:17 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-13 22:23 [PATCH] PM: Introduce core framework for run-time PM of I/O devices Rafael J. Wysocki
2009-06-14  9:41 ` Magnus Damm
2009-06-14 10:29   ` Rafael J. Wysocki
2009-06-14  9:58 ` [linux-pm] " Rafael J. Wysocki
2009-06-14 22:57   ` [patch update] " Rafael J. Wysocki
2009-06-14 23:18     ` Arjan van de Ven
2009-06-15 20:02       ` Rafael J. Wysocki
2009-06-15 21:08     ` Alan Stern
2009-06-15 23:21       ` Rafael J. Wysocki
2009-06-16 14:30         ` Alan Stern
2009-06-16 21:30           ` [patch update 2] " Rafael J. Wysocki
2009-06-16 22:33             ` [patch update 2 fix] " Rafael J. Wysocki
2009-06-17 20:08               ` Alan Stern
2009-06-17 23:07                 ` Rafael J. Wysocki
2009-06-18 18:17                   ` Alan Stern
2009-06-19  0:38                     ` Rafael J. Wysocki
2009-06-19 16:25                       ` Alan Stern
2009-06-19 22:42                         ` Rafael J. Wysocki
2009-06-20  2:34                           ` Alan Stern
2009-06-20 14:30                             ` [linux-pm] " Alan Stern
2009-06-20 23:48                               ` Rafael J. Wysocki
2009-06-21  2:30                                 ` Alan Stern
2009-06-21 11:32                                   ` Rafael J. Wysocki
2009-06-22 14:16                                     ` Alan Stern
2009-06-22 15:27                                       ` Rafael J. Wysocki
2009-06-22 15:39                                         ` Alan Stern
2009-06-22 15:53                                           ` Rafael J. Wysocki
2009-06-22  6:20                               ` Magnus Damm
2009-06-22  6:43                                 ` Arjan van de Ven
2009-06-22  7:27                                   ` Magnus Damm
2009-06-22 13:49                                     ` [linux-pm] " Arjan van de Ven
2009-06-22 15:39                                       ` Rafael J. Wysocki
2009-06-22 15:33                                   ` Rafael J. Wysocki
2009-06-22  8:15                                 ` Oliver Neukum
2009-06-20 23:38                             ` [patch update 3] " Rafael J. Wysocki
2009-06-21  2:23                               ` Alan Stern
2009-06-21 12:46                                 ` Rafael J. Wysocki
2009-06-22 15:01                                   ` Alan Stern
2009-06-22 15:49                                     ` Rafael J. Wysocki
2009-06-22 16:28                                       ` Alan Stern
2009-06-22 23:02                                         ` Rafael J. Wysocki
2009-06-23 17:02                                       ` Alan Stern
2009-06-23 17:45                                         ` Rafael J. Wysocki
2009-06-23 18:26                                           ` Alan Stern
2009-06-24  0:17                                             ` Rafael J. Wysocki [this message]
2009-06-24 14:51                                               ` Alan Stern
2009-06-24 19:14                                                 ` Rafael J. Wysocki
2009-06-24 20:19                                                   ` Alan Stern
2009-06-24 21:23                                                     ` Rafael J. Wysocki
2009-06-24 15:04     ` [patch update] " Pavel Machek
2009-06-27 21:52       ` Rafael J. Wysocki
2009-07-06  8:28         ` Pavel Machek

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=200906240217.39608.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=gregkh@suse.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=magnus.damm@gmail.com \
    --cc=mingo@elte.hu \
    --cc=oliver@neukum.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