From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: amit daniel kachhap <amit.daniel@samsung.com>,
Kevin Hilman <khilman@kernel.org>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Kukjin Kim <kgene.kim@samsung.com>,
Mike Turquette <mturquette@linaro.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
pankaj.dubey@samsung.com,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>,
LAK <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 03/12] PM / Domains: Add notifier support for power domain transitions
Date: Tue, 04 Nov 2014 12:01:14 +0100 [thread overview]
Message-ID: <5458B1FA.7050401@samsung.com> (raw)
In-Reply-To: <CADGdYn5Prbbe6Rz=OfVMXm3dinCPrE-N0fn23dMMhZb8GzXm-Q@mail.gmail.com>
On 04/11/14 07:44, amit daniel kachhap wrote:
> On Mon, Nov 3, 2014 at 11:53 PM, Kevin Hilman <khilman@kernel.org> wrote:
>> "Rafael J. Wysocki" <rjw@rjwysocki.net> writes:
>>> On Monday, November 03, 2014 09:23:01 AM Amit Daniel Kachhap wrote:
>>>> These power domain transition notifiers will assist in carrying
>>>> out some activity associated with domain power on/off such as
>>>> some registers which may lose its contents and need save/restore
>>>> across domain power off/on.
>>
>> The runtime PM framework already provides callbacks that are useful for
>> context save/restore for devices. Could you please describe in more
>> detail which registers in which kind of devices need to be
>> saved/restored, and why they cannot be saved/restored using existing
>> mechanisms.
>
> Basically the requirement is mandated by exynos7 manual. It tells that
> before turning off the power domain, some clock registers need to saved
> and should be restored just after turning the power domain. These clock
> registers are not necessarily gate clocks but could be mux clocks etc.
> The driver may not have all information of these clocks also. I suppose
> these are Soc specific changes but drivers should work across Socs.
> This behavior is almost similar to suspend/resume case where a whole
> list of clock registers are saved/restored.
Indeed, the somehow complicated power domain power on/off sequences
are SoC specific. They involve not only groups of clocks (usually
gate, mux clock registers of all devices in a power domain) but also
SoC-specific PMU (Power Management Unit) registers.
I assume it would be inappropriate to push such details to device
drivers. Moreover, a device driver could not be even loaded.
Since the clocks' state is already maintained by clk driver we came
up with an idea of having generic calls from power domain driver back
to the clock controller driver.
It might not to be the prettiest solution, nevertheless I couldn't come
up with a better one which would satisfy all the requirements. The power
domain should only be provided for use with all the clk/PMU sequences
handling in place.
Clocks need to also be touched before a power domain switch on or off,
so attaching the clock controller to some power domain wouldn't help,
unless we modify/add to existing power domain related callbacks for
devices. Another issue is the clock controller device would need to
be attached to multiple power domains, and for each power domain the
power on/off sequence is usually slightly different.
There are also hierarchical power domains where each: the master and
the sub-domain need they own sequence and device usually is attached
only to a sub-domain.
> Even earlier post by Sylwester (https://lkml.org/lkml/2014/8/5/182)
> also points to the need of this feature.
>>
>> Personally, I'm uncomfortable with notifiers like this because it
>> suggests that underlying frameworks are not doing the right thing, or
>> are not being used. (I also don't like the implementation here where a
>> single global notifier list is maintained by the core, but the notifiers
>> are actually triggered by SoC specific code.)
>
> Yes right the global notifier block can be moved to per genpd structure.
> Also SoC trigger can be moved to core files.
>>
>> IIUC, the usage in this series seems to be that certain clock related
>> registers need to be saved/restored across a power domain transition.
>>
>> Wouldn't an alternative solution be to add a feature to the clock driver
>> such that the state of each clock is saved when the clock is disabled,
>> and restored when the clock is enabled? That would allow any clock
>> context to survive any power domain transtion also, correct?
>
> I also thought about same. But the trigger point for this would be
> driver calling clk disable/enable and not the power domain. so this
> will lead to lot of save/restore for each power domain child.
Even though we would have saved/restored at that points still the power
domain driver would need to enforce some specific clock/PMU registers
state before/after a power domain state transition. And this is what I
found difficult with the existing APIs.
--
Thanks,
Sylwester
WARNING: multiple messages have this Message-ID (diff)
From: s.nawrocki@samsung.com (Sylwester Nawrocki)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/12] PM / Domains: Add notifier support for power domain transitions
Date: Tue, 04 Nov 2014 12:01:14 +0100 [thread overview]
Message-ID: <5458B1FA.7050401@samsung.com> (raw)
In-Reply-To: <CADGdYn5Prbbe6Rz=OfVMXm3dinCPrE-N0fn23dMMhZb8GzXm-Q@mail.gmail.com>
On 04/11/14 07:44, amit daniel kachhap wrote:
> On Mon, Nov 3, 2014 at 11:53 PM, Kevin Hilman <khilman@kernel.org> wrote:
>> "Rafael J. Wysocki" <rjw@rjwysocki.net> writes:
>>> On Monday, November 03, 2014 09:23:01 AM Amit Daniel Kachhap wrote:
>>>> These power domain transition notifiers will assist in carrying
>>>> out some activity associated with domain power on/off such as
>>>> some registers which may lose its contents and need save/restore
>>>> across domain power off/on.
>>
>> The runtime PM framework already provides callbacks that are useful for
>> context save/restore for devices. Could you please describe in more
>> detail which registers in which kind of devices need to be
>> saved/restored, and why they cannot be saved/restored using existing
>> mechanisms.
>
> Basically the requirement is mandated by exynos7 manual. It tells that
> before turning off the power domain, some clock registers need to saved
> and should be restored just after turning the power domain. These clock
> registers are not necessarily gate clocks but could be mux clocks etc.
> The driver may not have all information of these clocks also. I suppose
> these are Soc specific changes but drivers should work across Socs.
> This behavior is almost similar to suspend/resume case where a whole
> list of clock registers are saved/restored.
Indeed, the somehow complicated power domain power on/off sequences
are SoC specific. They involve not only groups of clocks (usually
gate, mux clock registers of all devices in a power domain) but also
SoC-specific PMU (Power Management Unit) registers.
I assume it would be inappropriate to push such details to device
drivers. Moreover, a device driver could not be even loaded.
Since the clocks' state is already maintained by clk driver we came
up with an idea of having generic calls from power domain driver back
to the clock controller driver.
It might not to be the prettiest solution, nevertheless I couldn't come
up with a better one which would satisfy all the requirements. The power
domain should only be provided for use with all the clk/PMU sequences
handling in place.
Clocks need to also be touched before a power domain switch on or off,
so attaching the clock controller to some power domain wouldn't help,
unless we modify/add to existing power domain related callbacks for
devices. Another issue is the clock controller device would need to
be attached to multiple power domains, and for each power domain the
power on/off sequence is usually slightly different.
There are also hierarchical power domains where each: the master and
the sub-domain need they own sequence and device usually is attached
only to a sub-domain.
> Even earlier post by Sylwester (https://lkml.org/lkml/2014/8/5/182)
> also points to the need of this feature.
>>
>> Personally, I'm uncomfortable with notifiers like this because it
>> suggests that underlying frameworks are not doing the right thing, or
>> are not being used. (I also don't like the implementation here where a
>> single global notifier list is maintained by the core, but the notifiers
>> are actually triggered by SoC specific code.)
>
> Yes right the global notifier block can be moved to per genpd structure.
> Also SoC trigger can be moved to core files.
>>
>> IIUC, the usage in this series seems to be that certain clock related
>> registers need to be saved/restored across a power domain transition.
>>
>> Wouldn't an alternative solution be to add a feature to the clock driver
>> such that the state of each clock is saved when the clock is disabled,
>> and restored when the clock is enabled? That would allow any clock
>> context to survive any power domain transtion also, correct?
>
> I also thought about same. But the trigger point for this would be
> driver calling clk disable/enable and not the power domain. so this
> will lead to lot of save/restore for each power domain child.
Even though we would have saved/restored at that points still the power
domain driver would need to enforce some specific clock/PMU registers
state before/after a power domain state transition. And this is what I
found difficult with the existing APIs.
--
Thanks,
Sylwester
next prev parent reply other threads:[~2014-11-04 11:01 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-03 3:52 [PATCH 00/12] soc: samsung: Modify and enhance power domain driver Amit Daniel Kachhap
2014-11-03 3:52 ` Amit Daniel Kachhap
2014-11-03 3:52 ` [PATCH 01/12] ARM: EXYNOS: Move pmu specific header files under "linux/mfd/samsung" Amit Daniel Kachhap
2014-11-03 3:52 ` Amit Daniel Kachhap
2014-11-03 3:53 ` [PATCH 02/12] drivers: mfd: Add support for Exynos PMU driver Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
2014-11-03 15:26 ` Lee Jones
2014-11-03 15:26 ` Lee Jones
2014-11-04 3:18 ` Pankaj Dubey
2014-11-04 3:18 ` Pankaj Dubey
2014-11-04 8:24 ` Lee Jones
2014-11-04 8:24 ` Lee Jones
2014-11-05 13:47 ` Sylwester Nawrocki
2014-11-05 13:47 ` Sylwester Nawrocki
2014-11-03 3:53 ` [PATCH 03/12] PM / Domains: Add notifier support for power domain transitions Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
2014-11-03 14:54 ` Rafael J. Wysocki
2014-11-03 14:54 ` Rafael J. Wysocki
2014-11-03 14:52 ` Ulf Hansson
2014-11-03 14:52 ` Ulf Hansson
2014-11-04 6:18 ` amit daniel kachhap
2014-11-04 6:18 ` amit daniel kachhap
2014-11-03 18:23 ` Kevin Hilman
2014-11-03 18:23 ` Kevin Hilman
2014-11-04 6:44 ` amit daniel kachhap
2014-11-04 6:44 ` amit daniel kachhap
2014-11-04 11:01 ` Sylwester Nawrocki [this message]
2014-11-04 11:01 ` Sylwester Nawrocki
2014-11-07 18:45 ` Kevin Hilman
2014-11-07 18:45 ` Kevin Hilman
2014-11-10 9:08 ` amit daniel kachhap
2014-11-10 9:08 ` amit daniel kachhap
2014-11-28 18:04 ` Sylwester Nawrocki
2014-11-28 18:04 ` Sylwester Nawrocki
2014-11-03 18:21 ` Sylwester Nawrocki
2014-11-03 18:21 ` Sylwester Nawrocki
2014-11-03 18:41 ` Sylwester Nawrocki
2014-11-03 18:41 ` Sylwester Nawrocki
2014-11-04 3:23 ` Pankaj Dubey
2014-11-04 3:23 ` Pankaj Dubey
2014-11-04 6:16 ` amit daniel kachhap
2014-11-04 6:16 ` amit daniel kachhap
2014-11-04 12:08 ` Sylwester Nawrocki
2014-11-04 12:08 ` Sylwester Nawrocki
2014-11-04 18:10 ` [RFC PATCH] pm: Add PM domain state transition notifications Sylwester Nawrocki
2014-11-04 18:10 ` Sylwester Nawrocki
2014-11-03 3:53 ` [PATCH 04/12] mfd: exynos-pmu: Register exynos-pmu driver as a mfd driver Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
2014-11-03 3:53 ` [PATCH 05/12] arm: exynos: Add platform driver support for power domain driver Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
2014-11-03 3:53 ` [PATCH 06/12] soc: exynos: Move exynos power domain file to driver/soc/samsung folder Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
2014-11-03 3:53 ` [PATCH 07/12] soc: samsung: pm_domain: Use compatible name for power domain name Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
2014-11-03 3:53 ` [PATCH 08/12] soc: samsung: pm_domain: Add a new parameter for power configuration Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
2014-11-03 3:53 ` [PATCH 09/12] soc: samsung: pm_domain: Add support for parent power domain Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
2014-11-03 3:53 ` [PATCH 10/12] soc: samsung: pm_domain: Use the recently added PM Domain notifiers Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
2014-11-03 3:53 ` [PATCH 11/12] clk: samsung: save and restore clock registers for power domain Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
2014-11-03 3:53 ` [PATCH 12/12] arm64: Kconfig: Enable PM_GENERIC_DOMAINS for exynos7 Amit Daniel Kachhap
2014-11-03 3:53 ` Amit Daniel Kachhap
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=5458B1FA.7050401@samsung.com \
--to=s.nawrocki@samsung.com \
--cc=amit.daniel@samsung.com \
--cc=geert@linux-m68k.org \
--cc=kgene.kim@samsung.com \
--cc=khilman@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=pankaj.dubey@samsung.com \
--cc=rafael.j.wysocki@intel.com \
--cc=rjw@rjwysocki.net \
--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 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.