Skip to content

Commit

Permalink
[ARM] omap: fix clockdomain enable/disable ordering
Browse files Browse the repository at this point in the history
Based on a patch from Paul Walmsley <paul@pwsan.com>:

 omap2_clk_enable() should enable a clock's clockdomain before
 attempting to enable its parent clock's clockdomain.  Similarly, in
 the unlikely event that the parent clock enable fails, the clockdomain
 should be disabled.

 linux-omap source commit is 6d6e285e5a7912b1ea68fadac387304c914aaba8.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Russell King authored and Russell King committed Feb 8, 2009
1 parent a7f8c59 commit 8263e5b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions arch/arm/mach-omap2/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,20 +419,17 @@ int omap2_clk_enable(struct clk *clk)
int ret = 0;

if (clk->usecount++ == 0) {
if (clk->clkdm)
omap2_clkdm_clk_enable(clk->clkdm, clk);

if (clk->parent) {
ret = omap2_clk_enable(clk->parent);
if (ret)
goto err;
}

if (clk->clkdm)
omap2_clkdm_clk_enable(clk->clkdm, clk);

ret = _omap2_clk_enable(clk);
if (ret) {
if (clk->clkdm)
omap2_clkdm_clk_disable(clk->clkdm, clk);

if (clk->parent)
omap2_clk_disable(clk->parent);

Expand All @@ -442,6 +439,8 @@ int omap2_clk_enable(struct clk *clk)
return ret;

err:
if (clk->clkdm)
omap2_clkdm_clk_disable(clk->clkdm, clk);
clk->usecount--;
return ret;
}
Expand Down

0 comments on commit 8263e5b

Please sign in to comment.