From: Kevin Hilman <khilman@kernel.org>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: Thierry Reding <thierry.reding@gmail.com>,
Ulf Hansson <ulf.hansson@linaro.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Alan Stern <stern@rowland.harvard.edu>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Tomasz Figa <tomasz.figa@gmail.com>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Simon Horman <horms@verge.net.au>,
Magnus Damm <magnus.damm@gmail.com>,
Ben Dooks <ben-linux@fluff.org>,
Kukjin Kim <kgene.kim@samsung.com>,
Philipp Zabel <philipp.zabel@gmail.com>Ma
Subject: Re: [PATCH v5 00/11] PM / Domains: Generic OF-based support
Date: Thu, 25 Sep 2014 22:08:03 -0700 [thread overview]
Message-ID: <7hvbob6kb0.fsf@deeprootsystems.com> (raw)
In-Reply-To: <20140926002757.GJ10233@codeaurora.org> (Stephen Boyd's message of "Thu, 25 Sep 2014 17:27:57 -0700")
Stephen Boyd <sboyd@codeaurora.org> writes:
> On 09/25, Thierry Reding wrote:
[...]
>> The critical part is that we need to enable the clock after the
>> partition has been powered, but before the clamps are removed.
>> Implementing this with runtime PM support in drivers won't work
>> because the power domain driver has to do both the powering up
>> and removing the clamps, so there's no place to inject the call
>> to enable the clock.
>
> FWIW, Qualcomm platforms have pretty much the same design. Our
> power domain controls live in the same register space as the
> clocks and resets. Is Tegra the same way? To power on/off a
> domain we need to go and forcefully turn a clock on and assert a
> reset or perhaps we need the clock to be off and assert a reset.
> It depends on the domain.
>
> Historically we've supported this by requiring all drivers to
> disable their clocks and deassert any resets before calling into
> this code (we put this behind the regulator API). Then we're free
> to do whatever is necessary to power on/off, eventally leaving
> the clocks off if they were forced on and finally giving control
> to the drivers so they can manage their own clocks and resets. It
> would be better for us to take ownership of the clocks and resets
> in the domain so we don't have this prerequisite of clocks being
> off before calling into the domain code. I plan to do pretty much
> Kevin outlined and use runtime PM, power domains, and per-device
> pm QoS to figure out if we should gate clocks (clk_disable), or
> if we go to a lower power mode where we unprepare clocks
> (clk_unprepare), or if we go to the lowest power mode where we
> apply clamps, etc. (called power collapse for us). Then the
> drivers just interact with runtime PM and QoS and they aren't
> aware of all this SoC glue.
Excellent! I'm glad you're heading in that direction. One other
important point here is that keeping drivers "simple" like this makes it
much easier for them to stay portable across SoCs.
Also, neither tegra or qcom are unique here.
FWIW, OMAP has similar ordering requirements, and quite a bit of "stuff"
to properly get a device and powerdomain to actually power down (and
power up) properly. The OMAP implementation pre-dates runtime PM, power
domains etc. so we hid all of this behind the omap_hwmod abstraction and
the omap_device API where all clocks, resets, and various other magic is
handled, and so that device drivers didn't have to care about the details.
These days, those APIs are now used by the OMAP pm_domain implementation
(which pre-dates genpd), so drivers (still) don't have to care about the
details only have to care about runtime PM and QoS. After genpd came
along, the goal was to convert OMAP to it, but well, other circumstances
have changed things such that those working in that area are, um...,
somewhat less focused on OMAP. ;)
Kevin
next prev parent reply other threads:[~2014-09-26 5:08 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-19 18:27 [PATCH v5 00/11] PM / Domains: Generic OF-based support Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 01/11] PM / Domains: Add a detach callback to the struct dev_pm_domain Ulf Hansson
2014-09-22 11:15 ` Geert Uytterhoeven
2014-09-19 18:27 ` [PATCH v5 02/11] ACPI / PM: Assign the ->detach() callback when attaching the PM domain Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 03/11] PM / Domains: Add generic OF-based PM domain look-up Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 04/11] PM / Domains: Add APIs to attach/detach a PM domain for a device Ulf Hansson
2014-09-22 11:12 ` Geert Uytterhoeven
2014-09-19 18:27 ` [PATCH v5 05/11] drivercore / platform: Convert to dev_pm_domain_attach|detach() Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 08/11] spi: core: " Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 09/11] amba: Add support for attach/detach of PM domains Ulf Hansson
[not found] ` <1411151264-16245-1-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-09-19 18:27 ` [PATCH v5 06/11] i2c: core: Convert to dev_pm_domain_attach|detach() Ulf Hansson
[not found] ` <1411151264-16245-7-git-send-email-ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-09-20 12:23 ` Wolfram Sang
2014-09-20 23:48 ` Rafael J. Wysocki
2014-09-22 9:52 ` Mika Westerberg
2014-09-22 10:00 ` Wolfram Sang
2014-09-19 18:27 ` [PATCH v5 07/11] mmc: sdio: " Ulf Hansson
2014-10-02 0:27 ` Dmitry Torokhov
2014-10-13 2:48 ` Aaron Lu
2014-10-13 11:44 ` Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 10/11] ARM: exynos: Move to generic PM domain DT bindings Ulf Hansson
2014-09-19 18:27 ` [PATCH v5 11/11] ACPI / PM: Convert acpi_dev_pm_detach() into a static function Ulf Hansson
2014-09-19 18:48 ` [PATCH v5 00/11] PM / Domains: Generic OF-based support Dmitry Torokhov
2014-09-22 14:19 ` Rafael J. Wysocki
2014-09-22 19:04 ` Ulf Hansson
2014-09-23 1:42 ` Mark Brown
2014-09-24 12:44 ` Grygorii Strashko
2014-09-24 13:51 ` Rafael J. Wysocki
2014-09-24 13:59 ` Grygorii Strashko
2014-09-25 11:21 ` Thierry Reding
2014-09-25 15:29 ` Ulf Hansson
2014-09-25 16:56 ` Thierry Reding
2014-09-26 0:27 ` Stephen Boyd
2014-09-26 5:08 ` Kevin Hilman [this message]
2014-09-26 7:44 ` Thierry Reding
2014-09-25 22:45 ` Kevin Hilman
2014-09-26 7:31 ` Thierry Reding
2014-09-26 8:06 ` Geert Uytterhoeven
2014-09-26 9:56 ` Thierry Reding
2014-09-26 10:01 ` Geert Uytterhoeven
2014-09-26 10:04 ` Thierry Reding
2014-09-26 14:50 ` 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=7hvbob6kb0.fsf@deeprootsystems.com \
--to=khilman@kernel.org \
--cc=ben-linux@fluff.org \
--cc=daniel.lezcano@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=horms@verge.net.au \
--cc=kgene.kim@samsung.com \
--cc=len.brown@intel.com \
--cc=linus.walleij@linaro.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=pavel@ucw.cz \
--cc=philipp.zabel@gmail.com \
--cc=rjw@rjwysocki.net \
--cc=sboyd@codeaurora.org \
--cc=stern@rowland.harvard.edu \
--cc=thierry.reding@gmail.com \
--cc=tomasz.figa@gmail.com \
--cc=ulf.hansson@linaro.org \
/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;
as well as URLs for NNTP newsgroup(s).