linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Capella <sebastian.capella@linaro.org>
To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	linaro-kernel@lists.linaro.org
Cc: Sebastian Capella <sebastian.capella@linaro.org>,
	Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: [PATCH RFC] PM / Hibernate: no kernel_power_off when pm_power_off NULL
Date: Thu, 20 Mar 2014 13:53:15 -0700	[thread overview]
Message-ID: <1395348795-8554-2-git-send-email-sebastian.capella@linaro.org> (raw)
In-Reply-To: <1395348795-8554-1-git-send-email-sebastian.capella@linaro.org>

Reboot logic in kernel/reboot will avoid calling kernel_power_off
when pm_power_off is null, and instead uses kernel_halt.  Change
hibernate's power_down to follow the behavior in the reboot call.

Calling the notifier twice (once for SYS_POWER_OFF and again for
SYS_HALT) causes a panic during hibernation on Kirkwood
Openblocks A6 board.

Signed-off-by: Sebastian Capella <sebastian.capella@linaro.org>
Reported-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
---
 kernel/power/hibernate.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 37170d4..6a278dc 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -595,7 +595,8 @@ static void power_down(void)
 	case HIBERNATION_PLATFORM:
 		hibernation_platform_enter();
 	case HIBERNATION_SHUTDOWN:
-		kernel_power_off();
+		if (pm_power_off)
+			kernel_power_off();
 		break;
 #ifdef CONFIG_SUSPEND
 	case HIBERNATION_SUSPEND:
-- 
1.7.9.5

  reply	other threads:[~2014-03-20 20:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-20 20:53 [PATCH RFC 0/1] PM / Hibernate: no kernel_power_off when pm_power_off Sebastian Capella
2014-03-20 20:53 ` Sebastian Capella [this message]
2014-03-20 21:23   ` [PATCH RFC] PM / Hibernate: no kernel_power_off when pm_power_off NULL Pavel Machek
2014-03-20 21:35     ` One Thousand Gnomes
2014-03-20 21:36       ` Sebastian Capella
2014-03-26 17:22         ` Sebastian Capella
2014-04-15 18:34           ` Sebastian Capella
2014-04-15 20:54             ` Russell King - ARM Linux
2014-04-15 21:18               ` Pavel Machek
2014-04-16 16:28                 ` Sebastian Capella
2014-04-16 20:41                   ` Russell King - ARM Linux
2014-04-16 20:57                     ` One Thousand Gnomes
2014-04-16 21:09                       ` Russell King - ARM Linux
2014-04-18 21:38                         ` Sebastian Capella
2014-04-20 14:06                           ` Pavel Machek

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=1395348795-8554-2-git-send-email-sebastian.capella@linaro.org \
    --to=sebastian.capella@linaro.org \
    --cc=len.brown@intel.com \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --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 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).