From 8b8c3c7895dc8dcf60c58b23bc9231f4ee7887a2 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Mon, 12 Mar 2012 20:04:32 +0530 Subject: [PATCH] ARM: OMAP2+: 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. The missing wait for the powerdomain transition violates the sequence which the hardware expects, which causes power management failures on some devices. Fix this API by adding the pwrdm_wait_transition(). Signed-off-by: Santosh Shilimkar Cc: Rajendra Nayak Cc: Paul Walmsley [paul@pwsan.com: added some more details in the commit log] Signed-off-by: Paul Walmsley --- arch/arm/mach-omap2/powerdomain.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 8a18d1b..96ad3dbe 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -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) -- 2.7.4