linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Patrick Mochel <mochel@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Power Management Update
Date: Wed, 10 Sep 2003 20:10:19 +0200	[thread overview]
Message-ID: <20030910181019.GD2589@elf.ucw.cz> (raw)
In-Reply-To: <Pine.LNX.4.44.0309091726050.695-100000@cherise>

[-- Attachment #1: Type: text/plain, Size: 2184 bytes --]

Hi!

> <mochel@osdl.org> (03/09/09 1.1217.3.31)
>    [power] Revert swsusp to 2.6.0-test3 state.
>    
>    - From Pavel (mostly, though with some fixups).
>    - Note that I would never publically admit to putting such code into the 
>      kernel. 
>    - Someone ought to really review this patch some day. 

@@ -6,11 +6,12 @@
 #include <asm/desc.h>
 #include <asm/i387.h>

-static inline void
+static inline int
 arch_prepare_suspend(void)
 {
        if (!cpu_has_pse)
-               panic("pse required");
+               return -EPERM;
+       return 0;
 }

 /* image of the saved processor state */

You still want to do some printk(), otherwise we'll get very ugly bug
reports ("it does not suspend and I don't know why"). Also without
check in swsusp.c, this could corrupt data (page table accessed bits
might flip something during copy).

--- /usr/src/tmp/linux/kernel/power/swsusp.c	2003-09-10 19:58:08.000000000 +0200
+++ /usr/src/linux/kernel/power/swsusp.c	2003-09-10 19:57:16.000000000 +0200
@@ -697,7 +697,8 @@
 static void do_software_suspend(void)
 {
 	printk("Doing software_suspend()\n");
-	arch_prepare_suspend();
+	if (arch_prepare_suspend())
+		return;
 	if (pm_prepare_console())
 		printk( "%sCan't allocate a console... proceeding\n", name_suspend);
 	if (!prepare_suspend_processes()) {


Minor nits:

--- linux-2.5-virgin/kernel/power/pmdisk.c      Wed Dec 31 16:00:00 1969
+++ linux-2.5-power/kernel/power/pmdisk.c       Tue Sep  9 13:54:33 2003
@@ -0,0 +1,942 @@
+/*
+ * kernel/power/pmdisk.c - Suspend-to-disk implmentation
                                                ~ missing 'e'


+                               /* we ignore all swap devices that are
not the resume_file */
+                               if (1) {
+// FIXME                               if(resume_device ==
swap_info[i].swap_device) {
+                                       swapfile_used[i] =
SWAPFILE_SUSPEND;

If you want this FIXME fixed, I got patch from Aristeu Sergio Rozanski
Filho <aris@cathedrallabs.org>. Not yet tested, that's why I was
holding it. (attached).

								Pavel
-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

[-- Attachment #2: delme_swsusp-swap_name.diff --]
[-- Type: text/plain, Size: 1407 bytes --]

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1291  -> 1.1292 
#	kernel/power/swsusp.c	1.58    -> 1.59   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/08/28	aris@cathedrallabs.org	1.1292
# o only use swap device specified in resume= option
# --------------------------------------------
#
diff -Nru a/kernel/power/swsusp.c b/kernel/power/swsusp.c
--- a/kernel/power/swsusp.c	Thu Aug 28 21:07:20 2003
+++ b/kernel/power/swsusp.c	Thu Aug 28 21:07:20 2003
@@ -216,6 +216,7 @@
 static void read_swapfiles(void) /* This is called before saving image */
 {
 	int i, len;
+	char buff[sizeof(resume_file)], *sname;
 	
 	len=strlen(resume_file);
 	root_swap = 0xFFFF;
@@ -234,8 +235,11 @@
 					swapfile_used[i] = SWAPFILE_IGNORED;				  
 			} else {
 	  			/* we ignore all swap devices that are not the resume_file */
-				if (1) {
-// FIXME				if(resume_device == swap_info[i].swap_device) {
+				sname = d_path(swap_info[i].swap_file->f_dentry,
+					       swap_info[i].swap_file->f_vfsmnt,
+					       buff,
+					       sizeof(buff));
+				if (!strcmp(sname, resume_file)) {
 					swapfile_used[i] = SWAPFILE_SUSPEND;
 					root_swap = i;
 				} else {

  parent reply	other threads:[~2003-09-10 18:10 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-10  0:38 Power Management Update Patrick Mochel
2003-09-10 13:04 ` Daniele Venzano
2003-09-10 18:10 ` Pavel Machek [this message]
2003-09-11  4:45 ` Michael Frank
2003-09-11  6:06 ` CaT
     [not found] <3F5F9509.8080708@btopenworld.com>
2003-09-10 22:51 ` Patrick Mochel
  -- strict thread matches above, loose matches on Subject: below --
2003-09-10 19:53 Subodh Shrivastava
2003-09-10 21:09 ` Patrick Mochel
2003-09-10 20:44   ` Subodh Shrivastava
2003-09-11  0:12     ` Greg KH
     [not found] <20030904224112.GA26556@lps.ens.fr>
     [not found] ` <Pine.LNX.4.33.0309041637440.940-100000@localhost.localdomain>
2003-09-07  9:54   ` Éric Brunet
2003-09-08 19:54     ` Patrick Mochel
2003-09-09 10:53       ` Éric Brunet
2003-09-09 15:54         ` Patrick Mochel
2003-09-01 10:57 Éric Brunet
2003-08-30 21:25 Patrick Mochel
2003-08-31 12:31 ` Felipe Alfaro Solana
2003-08-31 13:04   ` Mathieu LESNIAK
2003-09-02 18:13     ` Patrick Mochel
2003-09-02 23:50       ` Éric Brunet
2003-09-02 23:59         ` Patrick Mochel
2003-09-03  9:41       ` Mathieu LESNIAK
2003-09-03 22:41         ` Patrick Mochel
2003-09-04  9:34           ` Éric Brunet
2003-09-04 19:34             ` Patrick Mochel
     [not found]           ` <20031013194127.GA16791@lps.ens.fr>
2003-10-18  9:48             ` =?unknown-8bit?Q?=C9ric?= Brunet
2003-08-31 21:28 ` Pavel Machek
2003-08-31 22:15 ` 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=20030910181019.GD2589@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    /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).