linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benoit Cousson <b-cousson@ti.com>
To: linux-omap@vger.kernel.org, khilman@deeprootsystems.com, paul@pwsan.com
Cc: rnayak@ti.com, santosh.shilimkar@ti.com,
	Liam Girdwood <lrg@slimlogic.co.uk>,
	Benoit Cousson <b-cousson@ti.com>
Subject: [PATCH 3/4] OMAP: hwmod: Fix omap_hwmod_reset wrong state test
Date: Wed,  4 Aug 2010 23:38:29 +0200	[thread overview]
Message-ID: <1280957910-22718-4-git-send-email-b-cousson@ti.com> (raw)
In-Reply-To: <1280957910-22718-1-git-send-email-b-cousson@ti.com>

From: Liam Girdwood <lrg@slimlogic.co.uk>

The reset function wrongly used the state flag as a bit mask and was trying
to re-enable after a reset.

hwmod is still enabled for the PRCM point of view after a softreset
so there is no need to re-enable.

Remove the state check from omap_hwmod_reset since the _reset
function is checking that as well and in addition can generate
a warning

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
[b-cousson@ti.com: remove the wrong test, remove the re-enable]
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Rajendra Nayak <rnayak@ti.com>
---
 arch/arm/mach-omap2/omap_hwmod.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 5bb25e3..100115f 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -1434,19 +1434,17 @@ void omap_hwmod_ocp_barrier(struct omap_hwmod *oh)
  *
  * Under some conditions, a driver may wish to reset the entire device.
  * Called from omap_device code.  Returns -EINVAL on error or passes along
- * the return value from _reset()/_enable().
+ * the return value from _reset().
  */
 int omap_hwmod_reset(struct omap_hwmod *oh)
 {
 	int r;
 
-	if (!oh || !(oh->_state & _HWMOD_STATE_ENABLED))
+	if (!oh)
 		return -EINVAL;
 
 	mutex_lock(&omap_hwmod_mutex);
 	r = _reset(oh);
-	if (!r)
-		r = _omap_hwmod_enable(oh);
 	mutex_unlock(&omap_hwmod_mutex);
 
 	return r;
-- 
1.6.1.3


  parent reply	other threads:[~2010-08-04 21:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-04 21:38 [PATCH 0/4] OMAP: hwmod & prcm fixes Benoit Cousson
2010-08-04 21:38 ` [PATCH 1/4] OMAP: hwmod: Rename dma_ch to dma_req Benoit Cousson
2010-08-04 21:38 ` [PATCH 2/4] OMAP: hwmod: Do not disable clocks if hwmod already in idle Benoit Cousson
2010-08-04 21:38 ` Benoit Cousson [this message]
2010-08-04 21:38 ` [PATCH 4/4] OMAP4: prcm: Fix global warm reset bit position Benoit Cousson
2010-08-14 17:03 ` [PATCH 0/4] OMAP: hwmod & prcm fixes 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=1280957910-22718-4-git-send-email-b-cousson@ti.com \
    --to=b-cousson@ti.com \
    --cc=khilman@deeprootsystems.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=paul@pwsan.com \
    --cc=rnayak@ti.com \
    --cc=santosh.shilimkar@ti.com \
    /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).