linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC/PATCH] arm: omap3: pm: do not clear power states twice
@ 2012-02-03  7:28 Felipe Balbi
  2012-02-03  8:04 ` Shilimkar, Santosh
  0 siblings, 1 reply; 3+ messages in thread
From: Felipe Balbi @ 2012-02-03  7:28 UTC (permalink / raw)
  To: Paul Walmsley
  Cc: Linux ARM Kernel Mailing List, Linux OMAP Mailing List,
	Kevin Hilman, Tony Lindgren, Benoit Cousson, Felipe Balbi

The way the code is written, pwrdm_pre_transion()
calls _pwrdm_pre_transition_cb() (for each powerdomain)
which, in turn, calls pwrdm_clear_all_prev_pwrst().

It looks unnecessary to clear all previous power
states twice, so drop the initial set.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---

Hasn't been tested yet. Compile tested only. It looks
like we can safely remove those calls, but I would
like to hear from the PM folks first :-)

 arch/arm/mach-omap2/pm34xx.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index fc69875..ca1704c 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -290,11 +290,6 @@ void omap_sram_idle(void)
 	int core_prev_state, per_prev_state;
 	u32 sdrc_pwr = 0;
 
-	pwrdm_clear_all_prev_pwrst(mpu_pwrdm);
-	pwrdm_clear_all_prev_pwrst(neon_pwrdm);
-	pwrdm_clear_all_prev_pwrst(core_pwrdm);
-	pwrdm_clear_all_prev_pwrst(per_pwrdm);
-
 	mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
 	switch (mpu_next_state) {
 	case PWRDM_POWER_ON:
@@ -312,8 +307,10 @@ void omap_sram_idle(void)
 	}
 
 	/* NEON control */
-	if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON)
+	if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON) {
+		pwrdm_clear_all_prev_pwrst(neon_pwrdm);
 		pwrdm_set_next_pwrst(neon_pwrdm, mpu_next_state);
+	}
 
 	/* Enable IO-PAD and IO-CHAIN wakeups */
 	per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
-- 
1.7.9


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC/PATCH] arm: omap3: pm: do not clear power states twice
  2012-02-03  7:28 [RFC/PATCH] arm: omap3: pm: do not clear power states twice Felipe Balbi
@ 2012-02-03  8:04 ` Shilimkar, Santosh
  2012-02-03  8:19   ` Felipe Balbi
  0 siblings, 1 reply; 3+ messages in thread
From: Shilimkar, Santosh @ 2012-02-03  8:04 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Paul Walmsley, Linux ARM Kernel Mailing List,
	Linux OMAP Mailing List, Kevin Hilman, Tony Lindgren,
	Benoit Cousson

On Fri, Feb 3, 2012 at 12:58 PM, Felipe Balbi <balbi@ti.com> wrote:
> The way the code is written, pwrdm_pre_transion()
> calls _pwrdm_pre_transition_cb() (for each powerdomain)
> which, in turn, calls pwrdm_clear_all_prev_pwrst().
>
> It looks unnecessary to clear all previous power
> states twice, so drop the initial set.
>
> Signed-off-by: Felipe Balbi <balbi@ti.com>
> ---
>
> Hasn't been tested yet. Compile tested only. It looks
> like we can safely remove those calls, but I would
> like to hear from the PM folks first :-)
>
Bit late :)

Paul already cleaned this up.
http://www.spinics.net/lists/linux-omap/msg63602.html

Regards
santosh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC/PATCH] arm: omap3: pm: do not clear power states twice
  2012-02-03  8:04 ` Shilimkar, Santosh
@ 2012-02-03  8:19   ` Felipe Balbi
  0 siblings, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2012-02-03  8:19 UTC (permalink / raw)
  To: Shilimkar, Santosh
  Cc: Felipe Balbi, Paul Walmsley, Linux ARM Kernel Mailing List,
	Linux OMAP Mailing List, Kevin Hilman, Tony Lindgren,
	Benoit Cousson

[-- Attachment #1: Type: text/plain, Size: 862 bytes --]

On Fri, Feb 03, 2012 at 01:34:55PM +0530, Shilimkar, Santosh wrote:
> On Fri, Feb 3, 2012 at 12:58 PM, Felipe Balbi <balbi@ti.com> wrote:
> > The way the code is written, pwrdm_pre_transion()
> > calls _pwrdm_pre_transition_cb() (for each powerdomain)
> > which, in turn, calls pwrdm_clear_all_prev_pwrst().
> >
> > It looks unnecessary to clear all previous power
> > states twice, so drop the initial set.
> >
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> > ---
> >
> > Hasn't been tested yet. Compile tested only. It looks
> > like we can safely remove those calls, but I would
> > like to hear from the PM folks first :-)
> >
> Bit late :)
> 
> Paul already cleaned this up.
> http://www.spinics.net/lists/linux-omap/msg63602.html

that's too bad. Missed an oportunity to have a commit on pm code, heh.
Anyway, thanks

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-03  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-03  7:28 [RFC/PATCH] arm: omap3: pm: do not clear power states twice Felipe Balbi
2012-02-03  8:04 ` Shilimkar, Santosh
2012-02-03  8:19   ` Felipe Balbi

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).