Patchwork [QUESTION] How to set static/dynamic dependency between clock domains

login
register
mail settings
Submitter tom.leiming@gmail.com
Date Dec. 16, 2011, 1:50 p.m.
Message ID <CACVXFVNOpfWxod_pN-kiQPoQ7n=XSFeV6WK6sf+8hYSiZ2rDBA@mail.gmail.com>
Download mbox | patch
Permalink /patch/131825/
State New
Headers show

Comments

tom.leiming@gmail.com - Dec. 16, 2011, 1:50 p.m.
Hi,

On Fri, Dec 16, 2011 at 9:24 PM, Ming Lei <tom.leiming@gmail.com> wrote:

> [1], add static dependency

Sorry for the mess, see attachment for the change.

thanks,
Santosh Shilimkar - Dec. 16, 2011, 3:13 p.m.
On Fri, Dec 16, 2011 at 7:20 PM, Ming Lei <tom.leiming@gmail.com> wrote:
> Hi,
>
> On Fri, Dec 16, 2011 at 9:24 PM, Ming Lei <tom.leiming@gmail.com> wrote:
>
>> [1], add static dependency
>
> Sorry for the mess, see attachment for the change.
>
Your patch is setting static dependency between ISS and l3_2.
It's not dynamic dep. Dynamic dep is managed through hardware and they
are not configurable. But with static dep. you can over-ride that behavior
as you have done.

This will impact power since l3_2 can't idle as long as iss clock
domain is active.

I need to check internal code-base but I don't remember this
issue observed so far.

Regards
Santosh
tom.leiming@gmail.com - Dec. 16, 2011, 3:46 p.m.
On Fri, Dec 16, 2011 at 11:13 PM, Shilimkar, Santosh
<santosh.shilimkar@ti.com> wrote:
> On Fri, Dec 16, 2011 at 7:20 PM, Ming Lei <tom.leiming@gmail.com> wrote:
>> Hi,
>>
>> On Fri, Dec 16, 2011 at 9:24 PM, Ming Lei <tom.leiming@gmail.com> wrote:
>>
>>> [1], add static dependency
>>
>> Sorry for the mess, see attachment for the change.
>>
> Your patch is setting static dependency between ISS and l3_2.
> It's not dynamic dep. Dynamic dep is managed through hardware and they

Yes, I see now,  L3_2_DYNDEP of CM_CAM_DYNAMICDEP is read only.

> are not configurable. But with static dep. you can over-ride that behavior
> as you have done.
>
> This will impact power since l3_2 can't idle as long as iss clock
> domain is active.
>
> I need to check internal code-base but I don't remember this
> issue observed so far.

In fact, I saw the issue on 3.2.0-rc5-next-20111216, and even
no such issue on 3.2.0-rc5.  After some bisecting, I found below
is the first commit on which the issue can be observed:

commit 3c50729b3fa1cd8ca1f347e6caf1081204cf1a7c
Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
Date:   Wed Jan 5 22:03:17 2011 +0530

    ARM: OMAP4: PM: Initialise all the clockdomains to supported states

    Initialise hardware supervised mode for all clockdomains if it's
    supported. Initiate sleep transition for other clockdomains,
    if they are not being used.


thanks,
Santosh Shilimkar - Dec. 16, 2011, 3:50 p.m.
On Fri, Dec 16, 2011 at 9:16 PM, Ming Lei <tom.leiming@gmail.com> wrote:
> On Fri, Dec 16, 2011 at 11:13 PM, Shilimkar, Santosh
> <santosh.shilimkar@ti.com> wrote:
>> On Fri, Dec 16, 2011 at 7:20 PM, Ming Lei <tom.leiming@gmail.com> wrote:
>>> Hi,
>>>
>>> On Fri, Dec 16, 2011 at 9:24 PM, Ming Lei <tom.leiming@gmail.com> wrote:
>>>
>>>> [1], add static dependency
>>>
>>> Sorry for the mess, see attachment for the change.
>>>
>> Your patch is setting static dependency between ISS and l3_2.
>> It's not dynamic dep. Dynamic dep is managed through hardware and they
>
> Yes, I see now,  L3_2_DYNDEP of CM_CAM_DYNAMICDEP is read only.
>
>> are not configurable. But with static dep. you can over-ride that behavior
>> as you have done.
>>
>> This will impact power since l3_2 can't idle as long as iss clock
>> domain is active.
>>
>> I need to check internal code-base but I don't remember this
>> issue observed so far.
>
> In fact, I saw the issue on 3.2.0-rc5-next-20111216, and even
> no such issue on 3.2.0-rc5.  After some bisecting, I found below
> is the first commit on which the issue can be observed:
>
> commit 3c50729b3fa1cd8ca1f347e6caf1081204cf1a7c
> Author: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Date:   Wed Jan 5 22:03:17 2011 +0530
>
>    ARM: OMAP4: PM: Initialise all the clockdomains to supported states
>
>    Initialise hardware supervised mode for all clockdomains if it's
>    supported. Initiate sleep transition for other clockdomains,
>    if they are not being used.
>
Before this patch all clock-domains were  put into SW forcewakeup
and hence the clock domains were not idling. With this patch now, hw
will take control of the clock-domain idle based on the domain
activities.

Regards
Santosh

Patch

diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index c264ef7..23e1f8c 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -198,6 +198,7 @@  static int __init omap4_pm_init(void)
 	int ret;
 	struct clockdomain *emif_clkdm, *mpuss_clkdm, *l3_1_clkdm;
 	struct clockdomain *ducati_clkdm, *l3_2_clkdm, *l4_per_clkdm;
+	struct clockdomain *iss_clkdm;
 
 	if (!cpu_is_omap44xx())
 		return -ENODEV;
@@ -227,8 +228,10 @@  static int __init omap4_pm_init(void)
 	l3_2_clkdm = clkdm_lookup("l3_2_clkdm");
 	l4_per_clkdm = clkdm_lookup("l4_per_clkdm");
 	ducati_clkdm = clkdm_lookup("ducati_clkdm");
+	iss_clkdm = clkdm_lookup("iss_clkdm");
 	if ((!mpuss_clkdm) || (!emif_clkdm) || (!l3_1_clkdm) ||
-		(!l3_2_clkdm) || (!ducati_clkdm) || (!l4_per_clkdm))
+		(!l3_2_clkdm) || (!ducati_clkdm) || (!l4_per_clkdm) ||
+		(!iss_clkdm))
 		goto err2;
 
 	ret = clkdm_add_wkdep(mpuss_clkdm, emif_clkdm);
@@ -237,6 +240,7 @@  static int __init omap4_pm_init(void)
 	ret |= clkdm_add_wkdep(mpuss_clkdm, l4_per_clkdm);
 	ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm);
 	ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm);
+	ret |= clkdm_add_wkdep(iss_clkdm, l3_2_clkdm);
 	if (ret) {
 		pr_err("Failed to add MPUSS -> L3/EMIF/L4PER, DUCATI -> L3 "
 				"wakeup dependency\n");