Commit 416db864 authored by Paul Walmsley's avatar Paul Walmsley Committed by Russell King

[ARM] OMAP3 clock: disable DPLL autoidle while waiting for DPLL to lock

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>.

linux-omap source commit is 3b7de4be.
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
Cc: Peter de Schrijver <peter.de-schrijver@nokia.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 95f538ac
...@@ -398,19 +398,14 @@ static int _omap3_noncore_dpll_lock(struct clk *clk) ...@@ -398,19 +398,14 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
ai = omap3_dpll_autoidle_read(clk); ai = omap3_dpll_autoidle_read(clk);
omap3_dpll_deny_idle(clk);
_omap3_dpll_write_clken(clk, DPLL_LOCKED); _omap3_dpll_write_clken(clk, DPLL_LOCKED);
if (ai) { r = _omap3_wait_dpll_status(clk, 1);
/*
* If no downstream clocks are enabled, CM_IDLEST bit if (ai)
* may never become active, so don't wait for DPLL to lock.
*/
r = 0;
omap3_dpll_allow_idle(clk); omap3_dpll_allow_idle(clk);
} else {
r = _omap3_wait_dpll_status(clk, 1);
omap3_dpll_deny_idle(clk);
};
return r; return r;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment