* [PATCH] PM: Prevent direct cpufreq scaling during initialization
@ 2009-12-02 10:12 Romit Dasgupta
2009-12-02 15:33 ` Sergey Lapin
2009-12-16 14:24 ` Kevin Hilman
0 siblings, 2 replies; 6+ messages in thread
From: Romit Dasgupta @ 2009-12-02 10:12 UTC (permalink / raw)
To: khilman; +Cc: linux-omap
It is seen that the OMAP specific cpufreq initialization code tries to
scale the MPU frequency to the highest possible without taking care of
the voltage level. On power on reset the power IC does not provide the
necessary voltage for the highest available MPU frequency (that would
satisfy all Si families). This potentially is an window of opportunity
for things to go wrong.
Signed-off-by: Romit Dasgupta <romit@ti.com>
---
diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
index 449b6b6..f94df20 100644
--- a/arch/arm/plat-omap/cpu-omap.c
+++ b/arch/arm/plat-omap/cpu-omap.c
@@ -149,8 +149,6 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy)
VERY_HI_RATE) / 1000;
}
- clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);
-
policy->min = policy->cpuinfo.min_freq;
policy->max = policy->cpuinfo.max_freq;
policy->cur = omap_getspeed(0);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] PM: Prevent direct cpufreq scaling during initialization
2009-12-02 10:12 [PATCH] PM: Prevent direct cpufreq scaling during initialization Romit Dasgupta
@ 2009-12-02 15:33 ` Sergey Lapin
2009-12-03 6:29 ` Dasgupta, Romit
2009-12-16 14:24 ` Kevin Hilman
1 sibling, 1 reply; 6+ messages in thread
From: Sergey Lapin @ 2009-12-02 15:33 UTC (permalink / raw)
To: romit; +Cc: khilman, linux-omap
On Wed, Dec 2, 2009 at 1:12 PM, Romit Dasgupta <romit@ti.com> wrote:
>
> It is seen that the OMAP specific cpufreq initialization code tries to
> scale the MPU frequency to the highest possible without taking care of
> the voltage level. On power on reset the power IC does not provide the
> necessary voltage for the highest available MPU frequency (that would
> satisfy all Si families). This potentially is an window of opportunity
> for things to go wrong.
>
>
> Signed-off-by: Romit Dasgupta <romit@ti.com>
> ---
> diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
> index 449b6b6..f94df20 100644
> --- a/arch/arm/plat-omap/cpu-omap.c
> +++ b/arch/arm/plat-omap/cpu-omap.c
> @@ -149,8 +149,6 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy)
> VERY_HI_RATE) / 1000;
> }
>
> - clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);
> -
> policy->min = policy->cpuinfo.min_freq;
> policy->max = policy->cpuinfo.max_freq;
> policy->cur = omap_getspeed(0);
This patch leads to hang with current PM branch, SRF and CPU IDLE enabled
on OMAP3525 rev C.
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] PM: Prevent direct cpufreq scaling during initialization
2009-12-02 15:33 ` Sergey Lapin
@ 2009-12-03 6:29 ` Dasgupta, Romit
2009-12-03 10:09 ` Sergey Lapin
0 siblings, 1 reply; 6+ messages in thread
From: Dasgupta, Romit @ 2009-12-03 6:29 UTC (permalink / raw)
To: Sergey Lapin; +Cc: khilman@deeprootsystems.com, linux-omap@vger.kernel.org
> > Signed-off-by: Romit Dasgupta <romit@ti.com>
> > ---
> > diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-
> omap.c
> > index 449b6b6..f94df20 100644
> > --- a/arch/arm/plat-omap/cpu-omap.c
> > +++ b/arch/arm/plat-omap/cpu-omap.c
> > @@ -149,8 +149,6 @@ static int __init omap_cpu_init(struct
> cpufreq_policy *policy)
> > VERY_HI_RATE) /
> 1000;
> > }
> >
> > - clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);
> > -
> > policy->min = policy->cpuinfo.min_freq;
> > policy->max = policy->cpuinfo.max_freq;
> > policy->cur = omap_getspeed(0);
>
> This patch leads to hang with current PM branch, SRF and CPU IDLE enabled
> on OMAP3525 rev C.
Verified this to work on Zoom2 + SRF + CPUidle. Can you give some debug info if possible?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PM: Prevent direct cpufreq scaling during initialization
2009-12-03 6:29 ` Dasgupta, Romit
@ 2009-12-03 10:09 ` Sergey Lapin
2009-12-04 10:47 ` Romit Dasgupta
0 siblings, 1 reply; 6+ messages in thread
From: Sergey Lapin @ 2009-12-03 10:09 UTC (permalink / raw)
To: Dasgupta, Romit; +Cc: khilman@deeprootsystems.com, linux-omap@vger.kernel.org
On Thu, Dec 3, 2009 at 9:29 AM, Dasgupta, Romit <romit@ti.com> wrote:
>
>
>> > Signed-off-by: Romit Dasgupta <romit@ti.com>
>> > ---
>> > diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-
>> omap.c
>> > index 449b6b6..f94df20 100644
>> > --- a/arch/arm/plat-omap/cpu-omap.c
>> > +++ b/arch/arm/plat-omap/cpu-omap.c
>> > @@ -149,8 +149,6 @@ static int __init omap_cpu_init(struct
>> cpufreq_policy *policy)
>> > VERY_HI_RATE) /
>> 1000;
>> > }
>> >
>> > - clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);
>> > -
>> > policy->min = policy->cpuinfo.min_freq;
>> > policy->max = policy->cpuinfo.max_freq;
>> > policy->cur = omap_getspeed(0);
>>
>> This patch leads to hang with current PM branch, SRF and CPU IDLE enabled
>> on OMAP3525 rev C.
> Verified this to work on Zoom2 + SRF + CPUidle. Can you give some debug info if possible?
>
Well, that looks like false alarm - I tried clean tree without local
patches, and it seems to work.
However, without this line removed, my system boots faster. Is it possible to
limit initial speed for unstable setups, but to boot as fast as possible?
Thanks a lot,
S.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PM: Prevent direct cpufreq scaling during initialization
2009-12-03 10:09 ` Sergey Lapin
@ 2009-12-04 10:47 ` Romit Dasgupta
0 siblings, 0 replies; 6+ messages in thread
From: Romit Dasgupta @ 2009-12-04 10:47 UTC (permalink / raw)
To: Sergey Lapin; +Cc: khilman@deeprootsystems.com, linux-omap@vger.kernel.org
Sergey Lapin wrote:
> On Thu, Dec 3, 2009 at 9:29 AM, Dasgupta, Romit <romit@ti.com> wrote:
>>
>>>> Signed-off-by: Romit Dasgupta <romit@ti.com>
>>>> ---
>>>> diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-
>>> omap.c
>>>> index 449b6b6..f94df20 100644
>>>> --- a/arch/arm/plat-omap/cpu-omap.c
>>>> +++ b/arch/arm/plat-omap/cpu-omap.c
>>>> @@ -149,8 +149,6 @@ static int __init omap_cpu_init(struct
>>> cpufreq_policy *policy)
>>>> VERY_HI_RATE) /
>>> 1000;
>>>> }
>>>>
>>>> - clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);
>>>> -
>>>> policy->min = policy->cpuinfo.min_freq;
>>>> policy->max = policy->cpuinfo.max_freq;
>>>> policy->cur = omap_getspeed(0);
>>> This patch leads to hang with current PM branch, SRF and CPU IDLE enabled
>>> on OMAP3525 rev C.
>> Verified this to work on Zoom2 + SRF + CPUidle. Can you give some debug info if possible?
>>
> Well, that looks like false alarm - I tried clean tree without local
> patches, and it seems to work.
>
> However, without this line removed, my system boots faster. Is it possible to
> limit initial speed for unstable setups, but to boot as fast as possible?
>
> Thanks a lot,
> S.
omap_cpufreq_init is a lateinitcall. So quite some part of the kernel startup
happens with whatever speed the bootloader passes control to kernel
initialization code. Only after we invoke omap_cpufreq_init will the cpufreq
framework try to call the offending code 'clk_set_rate'. Quite soon after this
the cpufreq default governor (whatever it is for your system, performance,
ondemand etc) is initialized. If you choose performance governor it will
immediately scale the frequency to the highest available for the system. So the
way to boot fast would be
a) make your bootcode scale the voltage + freq to support the highest cpu freq.
and/or
b) make performance governor the default.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] PM: Prevent direct cpufreq scaling during initialization
2009-12-02 10:12 [PATCH] PM: Prevent direct cpufreq scaling during initialization Romit Dasgupta
2009-12-02 15:33 ` Sergey Lapin
@ 2009-12-16 14:24 ` Kevin Hilman
1 sibling, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2009-12-16 14:24 UTC (permalink / raw)
To: romit; +Cc: linux-omap
Romit Dasgupta <romit@ti.com> writes:
> It is seen that the OMAP specific cpufreq initialization code tries to
> scale the MPU frequency to the highest possible without taking care of
> the voltage level. On power on reset the power IC does not provide the
> necessary voltage for the highest available MPU frequency (that would
> satisfy all Si families). This potentially is an window of opportunity
> for things to go wrong.
>
> Signed-off-by: Romit Dasgupta <romit@ti.com>
Looks good. Pulling into PM branch, and queing in pm-fixes for .33-rc
series.
Kevin
> ---
> diff --git a/arch/arm/plat-omap/cpu-omap.c b/arch/arm/plat-omap/cpu-omap.c
> index 449b6b6..f94df20 100644
> --- a/arch/arm/plat-omap/cpu-omap.c
> +++ b/arch/arm/plat-omap/cpu-omap.c
> @@ -149,8 +149,6 @@ static int __init omap_cpu_init(struct cpufreq_policy *policy)
> VERY_HI_RATE) / 1000;
> }
>
> - clk_set_rate(mpu_clk, policy->cpuinfo.max_freq * 1000);
> -
> policy->min = policy->cpuinfo.min_freq;
> policy->max = policy->cpuinfo.max_freq;
> policy->cur = omap_getspeed(0);
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-12-16 14:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-02 10:12 [PATCH] PM: Prevent direct cpufreq scaling during initialization Romit Dasgupta
2009-12-02 15:33 ` Sergey Lapin
2009-12-03 6:29 ` Dasgupta, Romit
2009-12-03 10:09 ` Sergey Lapin
2009-12-04 10:47 ` Romit Dasgupta
2009-12-16 14:24 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox