afd66179a4087016865fe45c3ff7c4b4e51de2e4
[openwrt/openwrt.git] / target / linux / mvebu / patches-3.18 / 060-cpuidle-mvebu-Fix-the-CPU-PM-notifier-usage.patch
1 From 43b68879de27b1993518687fbc6013da80cdcbfe Mon Sep 17 00:00:00 2001
2 From: Gregory CLEMENT <gregory.clement@free-electrons.com>
3 Date: Thu, 26 Feb 2015 18:20:48 +0100
4 Subject: [PATCH] cpuidle: mvebu: Fix the CPU PM notifier usage
5
6 As stated in kernel/cpu_pm.c, "Platform is responsible for ensuring
7 that cpu_pm_enter is not called twice on the same CPU before
8 cpu_pm_exit is called.". In the current code in case of failure when
9 calling mvebu_v7_cpu_suspend, the function cpu_pm_exit() is never
10 called whereas cpu_pm_enter() was called just before.
11
12 This patch moves the cpu_pm_exit() in order to balance the
13 cpu_pm_enter() calls.
14
15 Cc: stable@vger.kernel.org
16 Reported-by: Fulvio Benini <fbf@libero.it>
17 Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
18 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
19 ---
20 drivers/cpuidle/cpuidle-mvebu-v7.c | 4 ++--
21 1 file changed, 2 insertions(+), 2 deletions(-)
22
23 --- a/drivers/cpuidle/cpuidle-mvebu-v7.c
24 +++ b/drivers/cpuidle/cpuidle-mvebu-v7.c
25 @@ -37,11 +37,11 @@ static int mvebu_v7_enter_idle(struct cp
26 deepidle = true;
27
28 ret = mvebu_v7_cpu_suspend(deepidle);
29 + cpu_pm_exit();
30 +
31 if (ret)
32 return ret;
33
34 - cpu_pm_exit();
35 -
36 return index;
37 }
38