From: Kevin Hilman <khilman@deeprootsystems.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-pm@lists.linux-foundation.org, linux-omap@vger.kernel.org
Subject: Re: [linux-pm] [PATCH] PM: runtime PM + idle: allow usage when interrupts are disabled
Date: Thu, 19 Aug 2010 14:30:05 -0700 [thread overview]
Message-ID: <87lj82gujm.fsf@deeprootsystems.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1008132112090.24267-100000@netrider.rowland.org> (Alan Stern's message of "Fri, 13 Aug 2010 21:15:37 -0400 (EDT)")
Alan Stern <stern@rowland.harvard.edu> writes:
> On Tue, 10 Aug 2010, Kevin Hilman wrote:
>
>> When using runtime PM in combination with CPUidle, the runtime PM
>> transtions of some devices may be triggered during the idle path.
>> Late in the idle sequence, interrupts will likely be disabled when
>> runtime PM for these devices is initiated.
>>
>> Currently, the runtime PM core assumes methods are called with
>> interrupts enabled. However, if it is called with interrupts
>> disabled, the internal locking unconditionally enables interrupts, for
>> example:
>
> ...
>
>> Unconditionally enabling interrupts late in the idle sequence is not
>> desired behavior. To fix, use the save/restore versions of the
>> spinlock API.
>>
>> Reported-by: Partha Basak <p-basak2@ti.com>
>> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
>> ---
>> RFC: I'm not crazy about having the 'flags' in struct dev_pm_info, but
>> since the locks are taken and released in separate functions, this
>> seems better than changing the function APIs to pass around the flags.
>
> There are restrictions on what you're allowed to do with the flags, but
> I don't remember exactly what they are.
>
> In any case, I don't really like this change. It seems that we would
> be better off preventing the runtime PM calls from occurring in the
> first place while interrupts are disabled.
Why?
> In fact, it's hard to see what could cause this to happen at all.
As I mentioned in the changelog, this happens when trying to use runtime
PM in combination with CPUidle. As has been suggested elsewhere[1],
there is a need to do runtime PM on some devices in combination with CPU
idle transitions managed by CPUidle. However, late in the idle path,
at the time we want to manage these IO devices, interrupts are disabled.
Currently, on OMAP, we are already managing the power state of certain
IO devices along with CPUidle transitions using more brute force
methods. IMO, using runtime PM for this would be a much cleaner
approach. The only obstacle is the assumption that the API must be
called with interrupts enabled.
Kevin
[1] http://www.linuxplumbersconf.org/2010/ocw/proposals/717
next prev parent reply other threads:[~2010-08-19 21:30 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-10 16:54 [PATCH] PM: runtime PM + idle: allow usage when interrupts are disabled Kevin Hilman
2010-08-14 1:15 ` [linux-pm] " Alan Stern
2010-08-19 21:30 ` Kevin Hilman
2010-08-19 21:30 ` Kevin Hilman [this message]
2010-08-20 14:14 ` [linux-pm] " Alan Stern
2010-08-23 15:22 ` Kevin Hilman
2010-08-23 15:22 ` Kevin Hilman
2010-08-20 14:14 ` Alan Stern
2010-08-23 7:18 ` [linux-pm] " Pavel Machek
2010-08-23 7:18 ` Pavel Machek
2010-08-14 1:15 ` Alan Stern
2010-08-14 3:38 ` Ming Lei
2010-08-14 3:38 ` Ming Lei
2010-08-16 21:18 ` Rafael J. Wysocki
2010-08-16 21:18 ` [linux-pm] " Rafael J. Wysocki
2010-08-19 11:02 ` Basak, Partha
2010-08-19 11:02 ` Basak, Partha
2010-08-19 21:37 ` Kevin Hilman
2010-08-19 21:37 ` [linux-pm] " Kevin Hilman
2010-08-20 23:27 ` Rafael J. Wysocki
2010-08-20 23:27 ` [linux-pm] " Rafael J. Wysocki
2010-08-23 15:24 ` Kevin Hilman
2010-08-23 15:24 ` Kevin Hilman
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=87lj82gujm.fsf@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.