From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Hilman Subject: [PATCH 79/86] [ARM] omap: fix clockdomain enable/disable ordering Date: Thu, 12 Mar 2009 11:28:29 -0700 Message-ID: <1236882516-29403-80-git-send-email-khilman@deeprootsystems.com> References: <1236882516-29403-1-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-2-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-3-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-4-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-5-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-6-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-7-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-8-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-9-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-10-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-11-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-12-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-13-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-14-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-15-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-16-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-17-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-18-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-19-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-20-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-21-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-22-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-23-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-24-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-25-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-26-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-27-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-28-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-29-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-30-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-31-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-32-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-33-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-34-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-35-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-36-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-37-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-38-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-39-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-40-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-41-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-42-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-43-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-44-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-45-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-46-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-47-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-48-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-49-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-50-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-51-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-52-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-53-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-54-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-55-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-56-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-57-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-58-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-59-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-60-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-61-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-62-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-63-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-64-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-65-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-66-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-67-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-68-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-69-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-70-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-71-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-72-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-73-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-74-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-75-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-76-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-77-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-78-git-send-email-khilman@deeprootsystems.com> <1236882516-29403-79-git-send-email-khilman@deeprootsystems.com> Return-path: Received: from ag-out-0708.google.com ([72.14.246.250]:55744 "EHLO ag-out-0708.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757224AbZCLSeU (ORCPT ); Thu, 12 Mar 2009 14:34:20 -0400 Received: by ag-out-0708.google.com with SMTP id 26so1107479agb.10 for ; Thu, 12 Mar 2009 11:34:19 -0700 (PDT) In-Reply-To: <1236882516-29403-79-git-send-email-khilman@deeprootsystems.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: linux-omap@vger.kernel.org From: Russell King Based on a patch from Paul Walmsley : 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 --- arch/arm/mach-omap2/clock.c | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 222c2c0..1b40d75 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c @@ -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); @@ -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; } -- 1.6.1.2