Re: [PATCH 02/13] OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE

2010-06-29 Thread Kevin Hilman
Kevin Hilman khil...@deeprootsystems.com writes:

 Paul Walmsley p...@pwsan.com writes:

 Hi Kevin,

 something doesn't make sense in this patch...

 On Wed, 23 Jun 2010, Kevin Hilman wrote:

 If an omap_hwmod is setup using HWMOD_INIT_NO_IDLE flag, there is
 currently way to idle it since omap_hwmod_idle() requires the hwmod to
 be in the enabled state.

 The only thing that HWMOD_INIT_NO_IDLE does is prevent the hwmod from 
 being idled at the end of _setup().  By that time, the hwmod has already 
 been enabled, and its state has been set to _HWMOD_STATE_ENABLED.  So 
 there shouldn't be anything preventing the hwmod from being idled at that 
 point?

 Maybe the problem is that some hwmods were failing _wait_target_ready() 
 and so were never entering the ENABLED state?  If so, that looks like it's 
 fixed appropriately by your patch 3.

 Hmm, strange.  

 Indeed, this patch predates patch 3, so may not be necessary anymore.  I will
 check into it.


Just to update... this patch is no longer needed.  Dropping from the
series and an updated pm-hwmods branch has been pushed.

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/13] OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE

2010-06-24 Thread Kevin Hilman
Paul Walmsley p...@pwsan.com writes:

 Hi Kevin,

 something doesn't make sense in this patch...

 On Wed, 23 Jun 2010, Kevin Hilman wrote:

 If an omap_hwmod is setup using HWMOD_INIT_NO_IDLE flag, there is
 currently way to idle it since omap_hwmod_idle() requires the hwmod to
 be in the enabled state.

 The only thing that HWMOD_INIT_NO_IDLE does is prevent the hwmod from 
 being idled at the end of _setup().  By that time, the hwmod has already 
 been enabled, and its state has been set to _HWMOD_STATE_ENABLED.  So 
 there shouldn't be anything preventing the hwmod from being idled at that 
 point?

 Maybe the problem is that some hwmods were failing _wait_target_ready() 
 and so were never entering the ENABLED state?  If so, that looks like it's 
 fixed appropriately by your patch 3.

Hmm, strange.  

Indeed, this patch predates patch 3, so may not be necessary anymore.  I will
check into it.

Kevin
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/13] OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE

2010-06-23 Thread Kevin Hilman
If an omap_hwmod is setup using HWMOD_INIT_NO_IDLE flag, there is
currently way to idle it since omap_hwmod_idle() requires the hwmod to
be in the enabled state.

This patch adds a check to omap_hwmod_idle() so if the hwmod was has
the INIT_NO_IDLE flag, calling omap_hwmod_idle() will still succeed.

Cc: Paul Walmsley p...@pwsan.com
Signed-off-by: Kevin Hilman khil...@deeprootsystems.com
---
 arch/arm/mach-omap2/omap_hwmod.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index 95c9a5f..ac75407 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -938,7 +938,13 @@ static int _enable(struct omap_hwmod *oh)
  */
 static int _idle(struct omap_hwmod *oh)
 {
-   if (oh-_state != _HWMOD_STATE_ENABLED) {
+   /*
+* To idle, hwmod must be enabled, EXCEPT if hwmod was
+* initialized using the INIT_NO_IDLE flag.  In this case it
+* will not yet be enabled so we have to allow it to be idled.
+*/
+   if ((oh-_state != _HWMOD_STATE_ENABLED) 
+   !(oh-flags  HWMOD_INIT_NO_IDLE)) {
WARN(1, omap_hwmod: %s: idle state can only be entered from 
 enabled state\n, oh-name);
return -EINVAL;
@@ -953,6 +959,9 @@ static int _idle(struct omap_hwmod *oh)
 
oh-_state = _HWMOD_STATE_IDLE;
 
+   /* Clear init flag which should only affect first call to idle */
+   oh-flags = ~HWMOD_INIT_NO_IDLE;
+
return 0;
 }
 
-- 
1.7.0.2

--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 02/13] OMAP: hwmod: allow idle after HWMOD_INIT_NO_IDLE

2010-06-23 Thread Paul Walmsley
Hi Kevin,

something doesn't make sense in this patch...

On Wed, 23 Jun 2010, Kevin Hilman wrote:

 If an omap_hwmod is setup using HWMOD_INIT_NO_IDLE flag, there is
 currently way to idle it since omap_hwmod_idle() requires the hwmod to
 be in the enabled state.

The only thing that HWMOD_INIT_NO_IDLE does is prevent the hwmod from 
being idled at the end of _setup().  By that time, the hwmod has already 
been enabled, and its state has been set to _HWMOD_STATE_ENABLED.  So 
there shouldn't be anything preventing the hwmod from being idled at that 
point?

Maybe the problem is that some hwmods were failing _wait_target_ready() 
and so were never entering the ENABLED state?  If so, that looks like it's 
fixed appropriately by your patch 3.

 This patch adds a check to omap_hwmod_idle() so if the hwmod was has
 the INIT_NO_IDLE flag, calling omap_hwmod_idle() will still succeed.
 
 Cc: Paul Walmsley p...@pwsan.com
 Signed-off-by: Kevin Hilman khil...@deeprootsystems.com
 ---
  arch/arm/mach-omap2/omap_hwmod.c |   11 ++-
  1 files changed, 10 insertions(+), 1 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/omap_hwmod.c 
 b/arch/arm/mach-omap2/omap_hwmod.c
 index 95c9a5f..ac75407 100644
 --- a/arch/arm/mach-omap2/omap_hwmod.c
 +++ b/arch/arm/mach-omap2/omap_hwmod.c
 @@ -938,7 +938,13 @@ static int _enable(struct omap_hwmod *oh)
   */
  static int _idle(struct omap_hwmod *oh)
  {
 - if (oh-_state != _HWMOD_STATE_ENABLED) {
 + /*
 +  * To idle, hwmod must be enabled, EXCEPT if hwmod was
 +  * initialized using the INIT_NO_IDLE flag.  In this case it
 +  * will not yet be enabled so we have to allow it to be idled.
 +  */
 + if ((oh-_state != _HWMOD_STATE_ENABLED) 
 + !(oh-flags  HWMOD_INIT_NO_IDLE)) {
   WARN(1, omap_hwmod: %s: idle state can only be entered from 
enabled state\n, oh-name);
   return -EINVAL;
 @@ -953,6 +959,9 @@ static int _idle(struct omap_hwmod *oh)
  
   oh-_state = _HWMOD_STATE_IDLE;
  
 + /* Clear init flag which should only affect first call to idle */
 + oh-flags = ~HWMOD_INIT_NO_IDLE;


- Paul
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html