public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	LKML <linux-kernel@vger.kernel.org>, Pavel Machek <pavel@ucw.cz>,
	Nigel Cunningham <nigel@nigel.suspend2.net>,
	Pekka Enberg <penberg@cs.helsinki.fi>
Subject: [PATCH -mm] swsusp: Use reasonable default for hibernation_mode
Date: Tue, 8 May 2007 22:46:16 +0200	[thread overview]
Message-ID: <200705082246.17166.rjw@sisk.pl> (raw)
In-Reply-To: <1178538404.7261.16.camel@johannes.berg>

From: Rafael J. Wysocki <rjw@sisk.pl>

Make sure that hibernation_mode is set to a reasonable value by default.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 kernel/power/disk.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Index: linux-2.6.21/kernel/power/disk.c
===================================================================
--- linux-2.6.21.orig/kernel/power/disk.c	2007-05-06 14:40:12.000000000 +0200
+++ linux-2.6.21/kernel/power/disk.c	2007-05-08 22:12:02.000000000 +0200
@@ -30,8 +30,6 @@ char resume_file[256] = CONFIG_PM_STD_PA
 dev_t swsusp_resume_device;
 sector_t swsusp_resume_block;
 
-static int hibernation_mode;
-
 enum {
 	HIBERNATION_INVALID,
 	HIBERNATION_PLATFORM,
@@ -45,6 +43,8 @@ enum {
 #define HIBERNATION_MAX (__HIBERNATION_AFTER_LAST-1)
 #define HIBERNATION_FIRST (HIBERNATION_INVALID + 1)
 
+static int hibernation_mode = HIBERNATION_SHUTDOWN;
+
 struct hibernation_ops *hibernation_ops;
 
 /**
@@ -60,6 +60,11 @@ void hibernation_set_ops(struct hibernat
 	}
 	mutex_lock(&pm_mutex);
 	hibernation_ops = ops;
+	if (ops)
+		hibernation_mode = HIBERNATION_PLATFORM;
+	else if (hibernation_mode == HIBERNATION_PLATFORM)
+		hibernation_mode = HIBERNATION_SHUTDOWN;
+
 	mutex_unlock(&pm_mutex);
 }
 

  parent reply	other threads:[~2007-05-08 20:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-04  9:32 [PATCH -mm] PM: Separate hibernation code from suspend code Rafael J. Wysocki
2007-05-04 17:22 ` Satyam Sharma
2007-05-04 22:47   ` Rafael J. Wysocki
2007-05-05  6:31 ` Andrew Morton
2007-05-05 10:16   ` Rafael J. Wysocki
2007-05-05 12:21     ` Rafael J. Wysocki
2007-05-05 12:27       ` Johannes Berg
2007-05-05 13:50         ` Rafael J. Wysocki
2007-05-05 21:01           ` Pavel Machek
2007-05-07 11:46           ` Johannes Berg
2007-05-07 11:56             ` Johannes Berg
2007-05-07 21:35               ` Rafael J. Wysocki
2007-05-08  8:41                 ` Johannes Berg
2007-05-08 11:05                   ` Rafael J. Wysocki
2007-05-08 20:46             ` Rafael J. Wysocki [this message]
2007-05-05 16:55   ` Jason L Tibbitts III

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=200705082246.17166.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=akpm@linux-foundation.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nigel@nigel.suspend2.net \
    --cc=pavel@ucw.cz \
    --cc=penberg@cs.helsinki.fi \
    /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