From: Kevin Hilman <khilman@kernel.org>
To: Sylwester Nawrocki <s.nawrocki@samsung.com>
Cc: amit daniel kachhap <amit.daniel@samsung.com>,
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: Fri, 07 Nov 2014 10:45:20 -0800 [thread overview]
Message-ID: <7h8ujmsvcv.fsf@deeprootsystems.com> (raw)
In-Reply-To: <5458B1FA.7050401@samsung.com> (Sylwester Nawrocki's message of "Tue, 04 Nov 2014 12:01:14 +0100")
Sylwester Nawrocki <s.nawrocki@samsung.com> writes:
> 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.
For the clock tree, it still seems to me that this is better handled in
the SoC clock driver. For example, when a power domain is about to be
gated, all the devices in that domain are runtime suspended, and
presumably all of their gate clocks are disabled. Now, doesn't the
clock driver know the clock tree parent-child hierarchy and shouldn't it
be capable of saving the state of parent clocks (like mux clocks) etc?
Stated diffrently, it still seems to me like we're pushing functionality
in PM core notifiers that should be the responsibility of subsystem
drivers.
> 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.
This is what I'm not understanding.
Why can't the power domain driver's power_on/power_off callback just
call the PMU APIs and/or the clk_enable/_disable calls it needs?
Kevin
WARNING: multiple messages have this Message-ID (diff)
From: khilman@kernel.org (Kevin Hilman)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/12] PM / Domains: Add notifier support for power domain transitions
Date: Fri, 07 Nov 2014 10:45:20 -0800 [thread overview]
Message-ID: <7h8ujmsvcv.fsf@deeprootsystems.com> (raw)
In-Reply-To: <5458B1FA.7050401@samsung.com> (Sylwester Nawrocki's message of "Tue, 04 Nov 2014 12:01:14 +0100")
Sylwester Nawrocki <s.nawrocki@samsung.com> writes:
> 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.
For the clock tree, it still seems to me that this is better handled in
the SoC clock driver. For example, when a power domain is about to be
gated, all the devices in that domain are runtime suspended, and
presumably all of their gate clocks are disabled. Now, doesn't the
clock driver know the clock tree parent-child hierarchy and shouldn't it
be capable of saving the state of parent clocks (like mux clocks) etc?
Stated diffrently, it still seems to me like we're pushing functionality
in PM core notifiers that should be the responsibility of subsystem
drivers.
> 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.
This is what I'm not understanding.
Why can't the power domain driver's power_on/power_off callback just
call the PMU APIs and/or the clk_enable/_disable calls it needs?
Kevin
next prev parent reply other threads:[~2014-11-07 18:45 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
2014-11-04 11:01 ` Sylwester Nawrocki
2014-11-07 18:45 ` Kevin Hilman [this message]
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=7h8ujmsvcv.fsf@deeprootsystems.com \
--to=khilman@kernel.org \
--cc=amit.daniel@samsung.com \
--cc=geert@linux-m68k.org \
--cc=kgene.kim@samsung.com \
--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=s.nawrocki@samsung.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 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.