linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: b-cousson@ti.com (Benoit Cousson)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 4/6] OMAP2+: hwmod: Disable clocks when hwmod enable fails
Date: Wed, 15 Dec 2010 15:49:25 +0100	[thread overview]
Message-ID: <1292424567-25794-5-git-send-email-b-cousson@ti.com> (raw)
In-Reply-To: <1292424567-25794-1-git-send-email-b-cousson@ti.com>

From: Rajendra Nayak <rnayak@ti.com>

In cases where a module (hwmod) does not become accesible on enabling
the main clocks (can happen if there are external clocks needed
for the module to become accesible), make sure the clocks are not
left enabled.
This ensures that when the requisite external dependencies are met
a omap_hwmod_enable and omap_hwmod_idle/shutdown would rightly enable
and disable clocks using clk framework. Leaving the clocks enabled in
the error case causes additional usecounting at the clock framework
level leaving the clock enabled forever.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
---
 arch/arm/mach-omap2/omap_hwmod.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 91b011e..c576121 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1233,6 +1233,7 @@ static int _enable(struct omap_hwmod *oh)
 			_enable_sysc(oh);
 		}
 	} else {
+		_disable_clocks(oh);
 		pr_debug("omap_hwmod: %s: _wait_target_ready: %d\n",
 			 oh->name, r);
 	}
-- 
1.7.0.4

  parent reply	other threads:[~2010-12-15 14:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 14:49 [PATCH v2 0/6] OMAP: hwmod core fix and cleanup for 2.6.38 Benoit Cousson
2010-12-15 14:49 ` [PATCH v2 1/6] OMAP2+: hwmod: Make omap_hwmod_register private and remove omap_hwmod_unregister Benoit Cousson
2010-12-15 14:49 ` [PATCH v2 2/6] OMAP2+: hwmod: Mark functions used only during initialization with __init Benoit Cousson
2010-12-15 14:49 ` [PATCH v2 3/6] OMAP2+: hwmod: Remove omap_hwmod_mutex Benoit Cousson
2010-12-15 14:49 ` Benoit Cousson [this message]
2010-12-15 14:49 ` [PATCH v2 5/6] OMAP2+: hwmod: Add wakeup support for new OMAP4 IPs Benoit Cousson
2010-12-15 14:49 ` [PATCH v2 6/6] OMAP4: hwmod data: Add SIDLE_SMART_WKUP modes to several IPs Benoit Cousson
2010-12-21 23:17 ` [PATCH v2 0/6] OMAP: hwmod core fix and cleanup for 2.6.38 Paul Walmsley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1292424567-25794-5-git-send-email-b-cousson@ti.com \
    --to=b-cousson@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).