All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: rjw@rjwysocki.net
Cc: mxs@sbrk.org, gregory.clement@free-electrons.com,
	linux-kernel@vger.kernel.org,
	linux-pm@lists.linux-foundation.org
Subject: [PATCH 1/2] cpuidle: mvebu: Fix the CPU PM notifier usage
Date: Fri, 13 Mar 2015 18:43:51 +0100	[thread overview]
Message-ID: <1426268632-12800-1-git-send-email-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <55032186.3000306@linaro.org>

From: Gregory CLEMENT <gregory.clement@free-electrons.com>

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.

Cc: stable@vger.kernel.org
Reported-by: Fulvio Benini <fbf@libero.it>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 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 38e6861..cefa074 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;
 }
 
-- 
1.9.1


  reply	other threads:[~2015-03-13 17:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 17:42 [GIT PULL] cpuidle: 4.0-rc3 fixes Daniel Lezcano
2015-03-13 17:43 ` Daniel Lezcano [this message]
2015-03-13 17:43   ` [PATCH 2/2] cpuidle: mvebu: Update cpuidle thresholds for Armada XP SOCs Daniel Lezcano
2015-03-13 21:56 ` [GIT PULL] cpuidle: 4.0-rc3 fixes Rafael J. Wysocki
2015-03-13 21:38   ` Daniel Lezcano
2015-03-16  9:24   ` Geert Uytterhoeven
2015-03-17  2:37     ` Rafael J. Wysocki
2015-03-17  6:53       ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426268632-12800-1-git-send-email-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=gregory.clement@free-electrons.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=mxs@sbrk.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.