Skip to contentSkip to conversation

ARM: OMAP4: powerdomain: Misc powerdomain fix and associated cleanup

PATCH New Santosh Shilimkar 3 participants 12 messages Mar 12, 2012 – Apr 3, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover ARM: OMAP4: powerdomain: Misc powerdomain fix and associated cleanup

Paul,
Can you please have at this series ?
First patch is the bug fix and second one is the cleanup which you proposed some time back.

Santosh Shilimkar (2):
ARM: OMAP: powerdomain: Wait for powerdomain transition in
pwrdm_state_switch()
ARM: OMAP: powerdomain: Get rid off duplicate
pwrdm_clkdm_state_switch() API

 arch/arm/mach-omap2/clock.c       |    2 +-
 arch/arm/mach-omap2/clockdomain.c |    7 +++----
 arch/arm/mach-omap2/powerdomain.c |   14 +++++---------
 arch/arm/mach-omap2/powerdomain.h |    1 -
 4 files changed, 9 insertions(+), 15 deletions(-)
Signature · 1 line
1.7.4.1
#1 lore raw

PATCH 1/2 ARM: OMAP: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()

Commit b1cbdb00d{OMAP: clockdomain: Wait for powerdomain to be ON when using clockdomain force wakeup} was assuming that pwrdm_state_switch() does wait for the powerdomain transition which is not the case.

Fix this API by adding the pwrdm_wait_transition().

CC Rajendra Nayak <[email protected]>
CC Paul Walmsley <[email protected]>
---
 arch/arm/mach-omap2/powerdomain.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/powerdomain.c +7 -1
index 8a18d1b..96ad3dbe 100644
@@ -972,7 +972,13 @@ int pwrdm_wait_transition(struct powerdomain *pwrdm)
 
 int pwrdm_state_switch(struct powerdomain *pwrdm)
 {
-	return _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW);
+	int ret;
+
+	ret = pwrdm_wait_transition(pwrdm);
+	if (!ret)
+		ret = _pwrdm_state_switch(pwrdm, PWRDM_STATE_NOW);
+
+	return ret;
 }
 
 int pwrdm_clkdm_state_switch(struct clockdomain *clkdm)
Signature · 1 line
1.7.4.1
maintainer
#2 lore raw

PATCH 1/2 ARM: OMAP: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()

Quoted 9 lines · Santosh Shilimkar

Commit b1cbdb00d{OMAP: clockdomain: Wait for powerdomain to be ON when using clockdomain force wakeup} was assuming that pwrdm_state_switch() does wait for the powerdomain transition which is not the case.

Fix this API by adding the pwrdm_wait_transition().

CC Rajendra Nayak <[email protected]>
CC Paul Walmsley <[email protected]>

Sounds like this fixes a major kernel oops bug for Tony so this should go in ASAP to v3.3-rc series.

- Paul

maintainer
#3 lore raw

PATCH 1/2 ARM: OMAP: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()

Quoted 8 lines · Paul Walmsley
Quoted 6 lines · Santosh Shilimkar

Commit b1cbdb00d{OMAP: clockdomain: Wait for powerdomain to be ON when using clockdomain force wakeup} was assuming that pwrdm_state_switch() does wait for the powerdomain transition which is not the case.

Fix this API by adding the pwrdm_wait_transition().

Quoted 8 lines
Quoted 3 lines
CC Rajendra Nayak <[email protected]>
CC Paul Walmsley <[email protected]>

Sounds like this fixes a major kernel oops bug for Tony so this should go in ASAP to v3.3-rc series.

Got a random oops with this one applied still, just happened to take longer this time :(

Regards,

Tony

maintainer
#4 lore raw

PATCH 1/2 ARM: OMAP: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()

Quoted 13 lines · Tony Lindgren
Quoted 12 lines · Paul Walmsley
Quoted 9 lines · Santosh Shilimkar

Commit b1cbdb00d{OMAP: clockdomain: Wait for powerdomain to be ON when using clockdomain force wakeup} was assuming that pwrdm_state_switch() does wait for the powerdomain transition which is not the case.

Fix this API by adding the pwrdm_wait_transition().

CC Rajendra Nayak <[email protected]>
CC Paul Walmsley <[email protected]>
Quoted 7 lines
Quoted 4 lines

Sounds like this fixes a major kernel oops bug for Tony so this should go in ASAP to v3.3-rc series.

Got a random oops with this one applied still, just happened to take longer this time :(

Oh well. Will queue it for v3.4-rc1 then...

- Paul

maintainer
#5 lore raw

PATCH 1/2 ARM: OMAP: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()

Quoted 17 lines · Paul Walmsley
Quoted 15 lines · Tony Lindgren
Quoted 14 lines · Paul Walmsley
Quoted 9 lines · Santosh Shilimkar

Commit b1cbdb00d{OMAP: clockdomain: Wait for powerdomain to be ON when using clockdomain force wakeup} was assuming that pwrdm_state_switch() does wait for the powerdomain transition which is not the case.

Fix this API by adding the pwrdm_wait_transition().

CC Rajendra Nayak <[email protected]>
CC Paul Walmsley <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Sounds like this fixes a major kernel oops bug for Tony so this should go in ASAP to v3.3-rc series.

Got a random oops with this one applied still, just happened to take longer this time :(

Oh well. Will queue it for v3.4-rc1 then...

It seems that I need this patch plus need to undo the wrong serial muxing in commit 7496ba30 (ARM: OMAP2+: UART: Add default mux for all uarts) to make my zoom3 boot reliably.

Regards,

Tony

maintainer
#6 lore raw

PATCH 1/2 ARM: OMAP: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()

Quoted 3 lines · Tony Lindgren

It seems that I need this patch plus need to undo the wrong serial muxing in commit 7496ba30 (ARM: OMAP2+: UART: Add default mux for all uarts) to make my zoom3 boot reliably.

Okay. Well want to take the powerdomain patch for the v3.3-rc series then?

- Paul

maintainer
#7 lore raw

PATCH 1/2 ARM: OMAP: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()

Quoted 8 lines · Paul Walmsley
Quoted 3 lines · Tony Lindgren

It seems that I need this patch plus need to undo the wrong serial muxing in commit 7496ba30 (ARM: OMAP2+: UART: Add default mux for all uarts) to make my zoom3 boot reliably.

Okay. Well want to take the powerdomain patch for the v3.3-rc series then?

Uhh now got a random issue of "BUG: bad unlock balance detected".. Random oopses seem less common now, but still not booting reliably.

Regards,

Tony

maintainer
#8 lore raw

PATCH 1/2 ARM: OMAP: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()

In reply to Santosh Shilimkar
Quoted 9 lines · Santosh Shilimkar

Commit b1cbdb00d{OMAP: clockdomain: Wait for powerdomain to be ON when using clockdomain force wakeup} was assuming that pwrdm_state_switch() does wait for the powerdomain transition which is not the case.

Fix this API by adding the pwrdm_wait_transition().

CC Rajendra Nayak <[email protected]>
CC Paul Walmsley <[email protected]>

Thanks, queued for 3.4-rc.

- Paul

#9 lore raw

PATCH 2/2 ARM: OMAP: powerdomain: Get rid off duplicate pwrdm_clkdm_state_switch() API

In reply to Santosh Shilimkar

With patch 'ARM: OMAP: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()', the pwrdm_clkdm_state_switch() API becomes duplicate of pwrdm_state_switch().

Get rid off duplicate pwrdm_clkdm_state_switch() and update the users of it with pwrdm_state_switch()

CC Rajendra Nayak <[email protected]>
CC Paul Walmsley <[email protected]>
---
 arch/arm/mach-omap2/clock.c       |    2 +-
 arch/arm/mach-omap2/clockdomain.c |    7 +++----
 arch/arm/mach-omap2/powerdomain.c |   10 ----------
 arch/arm/mach-omap2/powerdomain.h |    1 -
 4 files changed, 4 insertions(+), 16 deletions(-)
arch/arm/mach-omap2/clock.c +1 -1
index f57ed5b..77db067 100644
@@ -439,7 +439,7 @@ void omap2_clk_disable_unused(struct clk *clk)
 		clk->ops->disable(clk);
 	}
 	if (clk->clkdm != NULL)
-		pwrdm_clkdm_state_switch(clk->clkdm);
+		pwrdm_state_switch(clk->clkdm->pwrdm.ptr);
 }
 #endif
 
arch/arm/mach-omap2/clockdomain.c +3 -4
index ad07689..8664f5a 100644
@@ -840,7 +840,7 @@ void clkdm_allow_idle(struct clockdomain *clkdm)
 	spin_lock_irqsave(&clkdm->lock, flags);
 	clkdm->_flags |= _CLKDM_FLAG_HWSUP_ENABLED;
 	arch_clkdm->clkdm_allow_idle(clkdm);
-	pwrdm_clkdm_state_switch(clkdm);
+	pwrdm_state_switch(clkdm->pwrdm.ptr);
 	spin_unlock_irqrestore(&clkdm->lock, flags);
 }
 
@@ -924,8 +924,7 @@ static int _clkdm_clk_hwmod_enable(struct clockdomain *clkdm)
 
 	spin_lock_irqsave(&clkdm->lock, flags);
 	arch_clkdm->clkdm_clk_enable(clkdm);
-	pwrdm_wait_transition(clkdm->pwrdm.ptr);
-	pwrdm_clkdm_state_switch(clkdm);
+	pwrdm_state_switch(clkdm->pwrdm.ptr);
 	spin_unlock_irqrestore(&clkdm->lock, flags);
 
 	pr_debug("clockdomain: clkdm %s: enabled\n", clkdm->name);
@@ -950,7 +949,7 @@ static int _clkdm_clk_hwmod_disable(struct clockdomain *clkdm)
 
 	spin_lock_irqsave(&clkdm->lock, flags);
 	arch_clkdm->clkdm_clk_disable(clkdm);
-	pwrdm_clkdm_state_switch(clkdm);
+	pwrdm_state_switch(clkdm->pwrdm.ptr);
 	spin_unlock_irqrestore(&clkdm->lock, flags);
 
 	pr_debug("clockdomain: clkdm %s: disabled\n", clkdm->name);
arch/arm/mach-omap2/powerdomain.c +0 -10
index 96ad3dbe..9611490 100644
@@ -981,16 +981,6 @@ int pwrdm_state_switch(struct powerdomain *pwrdm)
 	return ret;
 }
 
-int pwrdm_clkdm_state_switch(struct clockdomain *clkdm)
-{
-	if (clkdm != NULL && clkdm->pwrdm.ptr != NULL) {
-		pwrdm_wait_transition(clkdm->pwrdm.ptr);
-		return pwrdm_state_switch(clkdm->pwrdm.ptr);
-	}
-
-	return -EINVAL;
-}
-
 int pwrdm_pre_transition(void)
 {
 	pwrdm_for_each(_pwrdm_pre_transition_cb, NULL);
arch/arm/mach-omap2/powerdomain.h +0 -1
index 0d72a8a..8f88d65 100644
@@ -213,7 +213,6 @@ bool pwrdm_has_hdwr_sar(struct powerdomain *pwrdm);
 int pwrdm_wait_transition(struct powerdomain *pwrdm);
 
 int pwrdm_state_switch(struct powerdomain *pwrdm);
-int pwrdm_clkdm_state_switch(struct clockdomain *clkdm);
 int pwrdm_pre_transition(void);
 int pwrdm_post_transition(void);
 int pwrdm_set_lowpwrstchange(struct powerdomain *pwrdm);
Signature · 1 line
1.7.4.1
maintainer
#10 lore raw

PATCH 2/2 ARM: OMAP: powerdomain: Get rid off duplicate pwrdm_clkdm_state_switch() API

Quoted 10 lines · Santosh Shilimkar

With patch 'ARM: OMAP: powerdomain: Wait for powerdomain transition in pwrdm_state_switch()', the pwrdm_clkdm_state_switch() API becomes duplicate of pwrdm_state_switch().

Get rid off duplicate pwrdm_clkdm_state_switch() and update the users of it with pwrdm_state_switch()

CC Rajendra Nayak <[email protected]>
CC Paul Walmsley <[email protected]>

Thanks, queued for 3.5.

- Paul

#11 lore raw

cover ARM: OMAP4: powerdomain: Misc powerdomain fix and associated cleanup

In reply to Santosh Shilimkar
Quoted 5 lines · Santosh Shilimkar

Paul,
Can you please have at this series ?
First patch is the bug fix and second one is the cleanup which you proposed some time back.

In $subject
s/OMAP4/OMAP

Regards
Santosh