linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpuidle: mvebu: Fix the CPU PM notifier usage
@ 2015-02-26 17:20 Gregory CLEMENT
  2015-02-26 21:55 ` Rafael J. Wysocki
  0 siblings, 1 reply; 15+ messages in thread
From: Gregory CLEMENT @ 2015-02-26 17:20 UTC (permalink / raw)
  To: linux-arm-kernel

As stated in kernel/cpu_pm.c, "Platform is responsible for ensuring
that cpu_pm_enter is not called twice on the same CPU before
cpu_pm_exit is called.". In the current code in case of failure when
calling mvebu_v7_cpu_suspend, the function cpu_pm_exit() is never
called whereas cpu_pm_enter() was called just before.

This patch moves the cpu_pm_exit() in order to balance the
cpu_pm_enter() calls.

Reported-by: Fulvio Benini <fbf@libero.it>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
---
 drivers/cpuidle/cpuidle-mvebu-v7.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/cpuidle/cpuidle-mvebu-v7.c b/drivers/cpuidle/cpuidle-mvebu-v7.c
index 38e68618513a..cefa07438ae1 100644
--- a/drivers/cpuidle/cpuidle-mvebu-v7.c
+++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
@@ -37,11 +37,11 @@ static int mvebu_v7_enter_idle(struct cpuidle_device *dev,
 		deepidle = true;
 
 	ret = mvebu_v7_cpu_suspend(deepidle);
+	cpu_pm_exit();
+
 	if (ret)
 		return ret;
 
-	cpu_pm_exit();
-
 	return index;
 }
 
-- 
2.1.0

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

end of thread, other threads:[~2015-03-04 14:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-26 17:20 [PATCH] cpuidle: mvebu: Fix the CPU PM notifier usage Gregory CLEMENT
2015-02-26 21:55 ` Rafael J. Wysocki
2015-02-27  9:39   ` Gregory CLEMENT
2015-03-03 10:30     ` Daniel Lezcano
2015-03-03 10:34       ` Gregory CLEMENT
2015-03-03 10:52         ` Fulvio
2015-03-03 11:12           ` Daniel Lezcano
2015-03-03 12:51           ` Gregory CLEMENT
2015-03-03 13:00             ` Daniel Lezcano
2015-03-03 14:58             ` Fulvio
2015-03-03 15:20               ` Daniel Lezcano
2015-03-04 14:53                 ` Rafael J. Wysocki
2015-03-04 14:34                   ` Daniel Lezcano
2015-02-27 16:50   ` Daniel Lezcano
2015-02-27 22:18     ` Rafael J. Wysocki

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