* [PATCH] OMAP3 clock: disable DPLL autoidle while waiting for DPLL to lock
@ 2008-11-14 17:46 Paul Walmsley
2008-11-21 22:28 ` Tony Lindgren
0 siblings, 1 reply; 4+ messages in thread
From: Paul Walmsley @ 2008-11-14 17:46 UTC (permalink / raw)
To: linux-omap; +Cc: Peter de Schrijver, khilman
During _omap3_noncore_dpll_lock(), if a DPLL has no active downstream
clocks and DPLL autoidle is enabled, the DPLL may never lock, since it
will enter autoidle immediately. To resolve this, disable DPLL
autoidle while locking the DPLL, and unconditionally wait for the DPLL
to lock. This fixes some bugs where the kernel would hang when returning
from retention or return the wrong rate for the DPLL.
This patch is a collaboration with Peter de Schrijver
<peter.de-schrijver@nokia.com> and Kevin Hilman
<khilman@deeprootsystems.com>.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Peter de Schrijver <peter.de-schrijver@nokia.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/mach-omap2/clock34xx.c | 15 +++++----------
1 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
index 3a4e160..b8b4494 100644
--- a/arch/arm/mach-omap2/clock34xx.c
+++ b/arch/arm/mach-omap2/clock34xx.c
@@ -163,19 +163,14 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
ai = omap3_dpll_autoidle_read(clk);
+ omap3_dpll_deny_idle(clk);
+
_omap3_dpll_write_clken(clk, DPLL_LOCKED);
- if (ai) {
- /*
- * If no downstream clocks are enabled, CM_IDLEST bit
- * may never become active, so don't wait for DPLL to lock.
- */
- r = 0;
+ r = _omap3_wait_dpll_status(clk, 1);
+
+ if (ai)
omap3_dpll_allow_idle(clk);
- } else {
- r = _omap3_wait_dpll_status(clk, 1);
- omap3_dpll_deny_idle(clk);
- };
return r;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] OMAP3 clock: disable DPLL autoidle while waiting for DPLL to lock
2008-11-14 17:46 [PATCH] OMAP3 clock: disable DPLL autoidle while waiting for DPLL to lock Paul Walmsley
@ 2008-11-21 22:28 ` Tony Lindgren
2008-11-21 22:40 ` Kevin Hilman
0 siblings, 1 reply; 4+ messages in thread
From: Tony Lindgren @ 2008-11-21 22:28 UTC (permalink / raw)
To: Paul Walmsley; +Cc: linux-omap, Peter de Schrijver, khilman
* Paul Walmsley <paul@pwsan.com> [081114 09:46]:
>
> During _omap3_noncore_dpll_lock(), if a DPLL has no active downstream
> clocks and DPLL autoidle is enabled, the DPLL may never lock, since it
> will enter autoidle immediately. To resolve this, disable DPLL
> autoidle while locking the DPLL, and unconditionally wait for the DPLL
> to lock. This fixes some bugs where the kernel would hang when returning
> from retention or return the wrong rate for the DPLL.
>
> This patch is a collaboration with Peter de Schrijver
> <peter.de-schrijver@nokia.com> and Kevin Hilman
> <khilman@deeprootsystems.com>.
Pushing to l-o tree today.
Tony
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> Cc: Peter de Schrijver <peter.de-schrijver@nokia.com>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> ---
> arch/arm/mach-omap2/clock34xx.c | 15 +++++----------
> 1 files changed, 5 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
> index 3a4e160..b8b4494 100644
> --- a/arch/arm/mach-omap2/clock34xx.c
> +++ b/arch/arm/mach-omap2/clock34xx.c
> @@ -163,19 +163,14 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
>
> ai = omap3_dpll_autoidle_read(clk);
>
> + omap3_dpll_deny_idle(clk);
> +
> _omap3_dpll_write_clken(clk, DPLL_LOCKED);
>
> - if (ai) {
> - /*
> - * If no downstream clocks are enabled, CM_IDLEST bit
> - * may never become active, so don't wait for DPLL to lock.
> - */
> - r = 0;
> + r = _omap3_wait_dpll_status(clk, 1);
> +
> + if (ai)
> omap3_dpll_allow_idle(clk);
> - } else {
> - r = _omap3_wait_dpll_status(clk, 1);
> - omap3_dpll_deny_idle(clk);
> - };
>
> return r;
> }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] OMAP3 clock: disable DPLL autoidle while waiting for DPLL to lock
2008-11-21 22:28 ` Tony Lindgren
@ 2008-11-21 22:40 ` Kevin Hilman
2008-11-21 23:22 ` Paul Walmsley
0 siblings, 1 reply; 4+ messages in thread
From: Kevin Hilman @ 2008-11-21 22:40 UTC (permalink / raw)
To: Tony Lindgren; +Cc: Paul Walmsley, linux-omap, Peter de Schrijver
Tony Lindgren <tony@atomide.com> writes:
> * Paul Walmsley <paul@pwsan.com> [081114 09:46]:
>>
>> During _omap3_noncore_dpll_lock(), if a DPLL has no active downstream
>> clocks and DPLL autoidle is enabled, the DPLL may never lock, since it
>> will enter autoidle immediately. To resolve this, disable DPLL
>> autoidle while locking the DPLL, and unconditionally wait for the DPLL
>> to lock. This fixes some bugs where the kernel would hang when returning
>> from retention or return the wrong rate for the DPLL.
>>
>> This patch is a collaboration with Peter de Schrijver
>> <peter.de-schrijver@nokia.com> and Kevin Hilman
>> <khilman@deeprootsystems.com>.
>
> Pushing to l-o tree today.
>
Actually, I think Tero and Paul have a different fix for this now,
which is what I've included in the latest PM branch.
Tero can you send the updated version of you "Fix a bug with noncore
dpll rate calculation" patch?
Kevin
>
>
>> Signed-off-by: Paul Walmsley <paul@pwsan.com>
>> Cc: Peter de Schrijver <peter.de-schrijver@nokia.com>
>> Cc: Kevin Hilman <khilman@deeprootsystems.com>
>> ---
>> arch/arm/mach-omap2/clock34xx.c | 15 +++++----------
>> 1 files changed, 5 insertions(+), 10 deletions(-)
>>
>> diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c
>> index 3a4e160..b8b4494 100644
>> --- a/arch/arm/mach-omap2/clock34xx.c
>> +++ b/arch/arm/mach-omap2/clock34xx.c
>> @@ -163,19 +163,14 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
>>
>> ai = omap3_dpll_autoidle_read(clk);
>>
>> + omap3_dpll_deny_idle(clk);
>> +
>> _omap3_dpll_write_clken(clk, DPLL_LOCKED);
>>
>> - if (ai) {
>> - /*
>> - * If no downstream clocks are enabled, CM_IDLEST bit
>> - * may never become active, so don't wait for DPLL to lock.
>> - */
>> - r = 0;
>> + r = _omap3_wait_dpll_status(clk, 1);
>> +
>> + if (ai)
>> omap3_dpll_allow_idle(clk);
>> - } else {
>> - r = _omap3_wait_dpll_status(clk, 1);
>> - omap3_dpll_deny_idle(clk);
>> - };
>>
>> return r;
>> }
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] OMAP3 clock: disable DPLL autoidle while waiting for DPLL to lock
2008-11-21 22:40 ` Kevin Hilman
@ 2008-11-21 23:22 ` Paul Walmsley
0 siblings, 0 replies; 4+ messages in thread
From: Paul Walmsley @ 2008-11-21 23:22 UTC (permalink / raw)
To: Kevin Hilman; +Cc: Tony Lindgren, linux-omap, Peter de Schrijver
On Fri, 21 Nov 2008, Kevin Hilman wrote:
> Tony Lindgren <tony@atomide.com> writes:
>
> > * Paul Walmsley <paul@pwsan.com> [081114 09:46]:
> >>
> >> During _omap3_noncore_dpll_lock(), if a DPLL has no active downstream
> >> clocks and DPLL autoidle is enabled, the DPLL may never lock, since it
> >> will enter autoidle immediately. To resolve this, disable DPLL
> >> autoidle while locking the DPLL, and unconditionally wait for the DPLL
> >> to lock. This fixes some bugs where the kernel would hang when returning
> >> from retention or return the wrong rate for the DPLL.
> >>
> >> This patch is a collaboration with Peter de Schrijver
> >> <peter.de-schrijver@nokia.com> and Kevin Hilman
> >> <khilman@deeprootsystems.com>.
> >
> > Pushing to l-o tree today.
> >
>
> Actually, I think Tero and Paul have a different fix for this now,
> which is what I've included in the latest PM branch.
>
> Tero can you send the updated version of you "Fix a bug with noncore
> dpll rate calculation" patch?
No, this patch is still valid, and still should be pushed. The
calculation patch fixes a separate bug.
- Paul
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-11-21 23:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-14 17:46 [PATCH] OMAP3 clock: disable DPLL autoidle while waiting for DPLL to lock Paul Walmsley
2008-11-21 22:28 ` Tony Lindgren
2008-11-21 22:40 ` Kevin Hilman
2008-11-21 23:22 ` Paul Walmsley
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.