From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Huang Ying <ying.huang@intel.com>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [BUGFIX] PM: Fix active child counting when disabled and forbidden
Date: Wed, 14 Nov 2012 00:43:32 +0100 [thread overview]
Message-ID: <2088233.vqA5Fcid1o@vostro.rjw.lan> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1211121110520.26926-100000@netrider.rowland.org>
On Monday, November 12, 2012 11:32:26 AM Alan Stern wrote:
> On Mon, 12 Nov 2012, Huang Ying wrote:
>
> > > > Is it absolute necessary to call pm_runtime_set_suspended? If the
> > > > device is disabled, the transition to SUSPENDED state will not be
> > > > triggered even if the device is ACTIVE.
> > >
> > > It's not absolutely necessary to do this, but we ought to because it
> > > will allow the device's parent to be suspended. If we leave the device
> > > in the ACTIVE state then the parent can't be suspended, even when the
> > > device is disabled.
> >
> > I think this is the hard part of the issue. Now "disabled" and
> > SUSPENDED state is managed by hand. IMHO, if we changed
> > pm_runtime_allow() as you said, we need to change the rule too. Maybe
> > something as follow:
> >
> > - remove pm_runtime_set_suspended/pm_runtime_set_active
>
> We can't remove them entirely. They are needed for situations where
> the device's physical state is different from what the PM core thinks;
> they tell the PM core what the actual state is.
>
> > - in pm_runtime_disable/pm_runtime_allow, put device into SUSPENDED
> > state if runtime PM is not forbidden.
>
> That doesn't make sense. Runtime PM is never forbidden after
> pm_runtime_allow is called; that's its purpose.
>
> > - in pm_runtime_forbid/pm_runtime_enable, put device into ACTIVE state.
>
> Why should pm_runtime_enable put the device into the ACTIVE state?
>
> No, I think a better approach is simply to say that the device will
> never be allowed to be in the SUSPENDED state if runtime PM is
> forbidden. We already enforce this when the device is enabled for
> runtime PM, so we would have to start enforcing it when the device is
> disabled.
Sorry for the delay, I needed to take care of some ACPI changes urgently.
(Without reading the rest of the thread yet) I think that would be
a reasonable approach.
> This means:
>
> pm_runtime_set_suspended should fail if dev->power.runtime_auto
> is clear.
>
> pm_runtime_forbid should call pm_runtime_set_active if
> dev->power.disable_depth > 0. (This would run into a problem
> if the parent is suspended and disabled. Maybe
> pm_runtime_forbid should fail when this happens.)
>
> Finally, we probably should make a third change even though it isn't
> strictly necessary:
>
> pm_runtime_allow should call pm_runtime_set_suspended if
> dev->power.disable_depth > 0.
>
> Rafael, what do you think?
As I said, sounds reasonable.
Thanks,
Rafael
--
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
next prev parent reply other threads:[~2012-11-13 23:39 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-05 1:17 Huang Ying
2012-11-05 1:56 ` Alan Stern
2012-11-06 0:43 ` Huang Ying
2012-11-06 15:17 ` Alan Stern
2012-11-07 0:26 ` Huang Ying
2012-11-07 15:49 ` Alan Stern
2012-11-07 16:09 ` Rafael J. Wysocki
2012-11-07 17:17 ` Alan Stern
2012-11-07 20:21 ` Rafael J. Wysocki
2012-11-07 20:47 ` Alan Stern
2012-11-07 21:44 ` Rafael J. Wysocki
2012-11-07 21:56 ` Alan Stern
2012-11-07 22:51 ` Rafael J. Wysocki
2012-11-07 23:09 ` Rafael J. Wysocki
2012-11-08 1:15 ` Huang Ying
2012-11-08 1:35 ` Rafael J. Wysocki
2012-11-08 2:04 ` Huang Ying
2012-11-08 9:56 ` Rafael J. Wysocki
2012-11-08 17:07 ` Alan Stern
2012-11-09 2:36 ` Huang Ying
2012-11-09 16:41 ` Alan Stern
2012-11-12 0:37 ` Huang Ying
2012-11-12 2:36 ` Alan Stern
2012-11-12 5:55 ` Huang Ying
2012-11-12 16:32 ` Alan Stern
2012-11-13 1:19 ` Huang Ying
2012-11-13 2:32 ` Alan Stern
2012-11-13 5:12 ` Huang Ying
2012-11-13 16:10 ` Alan Stern
2012-11-14 1:08 ` Huang Ying
2012-11-14 9:52 ` Rafael J. Wysocki
2012-11-14 13:35 ` Huang Ying
2012-11-14 16:06 ` Alan Stern
2012-11-13 23:43 ` Rafael J. Wysocki [this message]
2012-11-14 10:05 ` Rafael J. Wysocki
2012-11-14 16:42 ` Alan Stern
2012-11-14 19:42 ` Rafael J. Wysocki
2012-11-14 21:45 ` Alan Stern
2012-11-14 23:10 ` Rafael J. Wysocki
2012-11-15 1:03 ` Huang Ying
2012-11-15 9:51 ` Rafael J. Wysocki
2012-11-15 10:09 ` Rafael J. Wysocki
2012-11-15 15:27 ` Alan Stern
2012-11-16 0:36 ` Huang Ying
2012-11-16 0:44 ` Rafael J. Wysocki
2012-11-16 0:48 ` Huang Ying
2012-11-16 0:55 ` Rafael J. Wysocki
2012-11-16 0:54 ` Huang Ying
2012-11-16 1:29 ` Rafael J. Wysocki
2012-11-16 1:27 ` Huang Ying
2012-11-16 10:10 ` Rafael J. Wysocki
2012-11-16 3:11 ` Huang Ying
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=2088233.vqA5Fcid1o@vostro.rjw.lan \
--to=rjw@sisk.pl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=ying.huang@intel.com \
/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®