public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: Question about expected behavior when PM runtime is disabled
Date: Mon, 20 Jun 2011 16:21:22 -0700	[thread overview]
Message-ID: <87sjr45bt9.fsf@ti.com> (raw)
In-Reply-To: <201106172129.42995.rjw@sisk.pl> (Rafael J. Wysocki's message of "Fri, 17 Jun 2011 21:29:42 +0200")

"Rafael J. Wysocki" <rjw@sisk.pl> writes:

> On Friday, June 17, 2011, Alan Stern wrote:
>> On Tue, 14 Jun 2011, Rafael J. Wysocki wrote:
>> 
>> > > Then you suggest:
>> > > 
>> > > 	Call pm_runtime_disable after .suspend;
>> > > 
>> > > 	Call pm_runtime_get_noresume and pm_runtime_enable before
>> > > 	.resume;
>> > > 
>> > > 	Call pm_runtime_put_sync after .complete.
>> > > 
>> > > Right?
>> > 
>> > Yes, that would be resonable IMO.
>> 
>> This turns out to be harder than it looks.  If an error occurs, we may
>> run the complete callback for devices that never were suspended or
>> resumed and hence never had their usage_count incremented.  How can we
>> tell that we need to skip the pm_runtime_put_sync for these devices?
>> 
>> Would it be okay to call pm_runtime_put_sync immediately after the
>> resume callback instead of after complete?
>
> Yes, it would.
>
> That said we may be better off by simply reverting commit
> e8665002477f0278f84f898145b1f141ba26ee26 (PM: Allow pm_runtime_suspend() to
> succeed during system suspend).

I'm OK with blocking runtime PM requests after .suspend (and unblocking
before .resume) e.g. protecting the _noirq callbacks, but I hope we
don't have to go back to blocking them before .prepare (and unblocking
after .complete)

Kevin

  reply	other threads:[~2011-06-20 23:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-10 22:54 Question about expected behavior when PM runtime is disabled Kenneth Heitke
2011-06-11 16:12 ` Alan Stern
2011-06-13 18:42   ` Kenneth Heitke
2011-06-13 19:28     ` Alan Stern
2011-06-13 19:51       ` Rafael J. Wysocki
2011-06-13 20:33         ` Alan Stern
2011-06-13 21:20           ` Rafael J. Wysocki
2011-06-14 13:47             ` Alan Stern
2011-06-14 20:01               ` Rafael J. Wysocki
2011-06-17 15:08                 ` Alan Stern
2011-06-17 19:29                   ` Rafael J. Wysocki
2011-06-20 23:21                     ` Kevin Hilman [this message]
2011-06-20 23:27                       ` 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=87sjr45bt9.fsf@ti.com \
    --to=khilman@ti.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