From: Kevin Hilman <khilman@deeprootsystems.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-pm@lists.linux-foundation.org
Subject: Re: runtime PM: common hooks for static and runtime PM
Date: Tue, 16 Mar 2010 14:31:35 -0700 [thread overview]
Message-ID: <87bpeovtqg.fsf@deeprootsystems.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1002041022140.2470-100000@iolanthe.rowland.org> (Alan Stern's message of "Thu\, 4 Feb 2010 10\:24\:48 -0500 \(EST\)")
Alan Stern <stern@rowland.harvard.edu> writes:
> On Wed, 3 Feb 2010, Kevin Hilman wrote:
>
>> Hello,
>>
>> I'm implementing runtime PM for the TI OMAP SoCs by overriding the
>> platform_bus hooks. All is working well for runtime PM, but it's
>> brought up a couple snags for static PM.
>>
>> Most of our drivers don't really need to distinguish between runtime
>> PM and static PM as we can hit the same power states when idle as we
>> can in suspend. Before switching to runtime PM we've been using the
>> clock framework to do both runtime PM and static PM. The driver would
>> disable its clocks & HW when idle and when going into suspend,
>> typically using a common 'disable' function.
>>
>> In converting a test driver to runtime PM, I just converted this
>> common disable function from a clock disable to a
>> pm_runtime_put_sync() and the common enable function to do a
>> pm_runtime_get_sync(). This all worked well for runtime PM, resulting
>> in my platform_pm_runtime_* hooks being called where I can then
>> disable/re-enable the clocks/HW etc. So far so good.
>>
>> However, I'm not able to use the common function in the static suspend
>> path because dpm_prepare() does a pm_runtime_get_no_resume() which
>> prevents any runtime PM transitions during suspend.
>>
>> I understand the motivation for this is probably to prevent runtime PM
>> transitions during static suspend, and that makes sense. However, I'm
>> wondering if there's some other way to handle my problem without
>> having to have the driver have different paths for static and runtime
>> PM.
>
> The system PM methods could directly call the runtime_suspend and
> runtime_resume methods (which presumably is where you actually disable
> or enable the clocks etc.), instead of going indirectly through
> pm_runtime_put_sync() and pm_runtime_get_sync().
>
[Revisiting this thread again... with a slightly different problem]
In my case, the driver's runtime_suspend and runtime_resume hooks are
not where the clocks are managed. The actual hardware enable/disable
is done in the bus-level runtime PM hooks, in this case platform_bus.
So having the system PM methods directly call the drivers runtime PM
methods doesn't help. In fact, because we handle the hardware at the
bus level, most drivers can live without any runtime PM methods, and
simply use get/put.
I've worked around this temporarily by calling the
bus->pm->runtime_suspend() and ->runtime_resume() methods from the
system PM methods, but am curious if that is an acceptable solution.
Kevin
next prev parent reply other threads:[~2010-03-16 21:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-03 23:30 runtime PM: common hooks for static and runtime PM Kevin Hilman
2010-02-04 15:24 ` Alan Stern
2010-02-05 10:43 ` Mark Brown
2010-02-05 15:41 ` Alan Stern
2010-02-05 16:11 ` Mark Brown
2010-02-05 21:40 ` Alan Stern
2010-02-05 22:44 ` Mark Brown
2010-02-06 2:57 ` Alan Stern
2010-02-06 15:46 ` Mark Brown
2010-02-06 16:18 ` Alan Stern
2010-02-08 14:54 ` Alan Stern
2010-02-24 18:14 ` Mark Brown
2010-02-24 18:56 ` Alan Stern
2010-02-24 22:32 ` Mark Brown
2010-02-25 15:26 ` Kevin Hilman
2010-03-16 21:31 ` Kevin Hilman [this message]
2010-03-17 14:47 ` Alan Stern
2010-03-17 16:42 ` Kevin Hilman
2010-03-17 17:10 ` Alan Stern
2010-03-17 21:46 ` Rafael J. Wysocki
2010-03-17 22:32 ` Kevin Hilman
2010-03-18 14:13 ` Alan Stern
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=87bpeovtqg.fsf@deeprootsystems.com \
--to=khilman@deeprootsystems.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox