Re: [PATCH] kernel/power/swsusp.c

From: Erik Rigtorp
Date: Mon Jul 05 2004 - 06:12:36 EST


On Sun, Jul 04, 2004 at 05:18:49PM +0200, Pavel Machek wrote:
> Actually, this has several advantages -- you can actually see the
> messages of the kernel during resume. And reading does logically
> belong to the kernel doing boot, so it belongs on its screen, too...

Here's a clean patch that does just that.
diff -Nru linux-2.6.7/kernel/power/swsusp.c linux-2.6.7-pavel/kernel/power/swsusp.c
--- linux-2.6.7/kernel/power/swsusp.c 2004-06-16 07:19:02.000000000 +0200
+++ linux-2.6.7-pavel/kernel/power/swsusp.c 2004-07-04 15:15:25.000000000 +0200
@@ -1190,9 +1190,6 @@
}
MDELAY(1000);

- if (pm_prepare_console())
- printk("swsusp: Can't allocate a console... proceeding\n");
-
if (!resume_file[0] && resume_status == RESUME_SPECIFIED) {
printk( "suspension device unspecified\n" );
return -EINVAL;
@@ -1201,12 +1198,15 @@
printk( "resuming from %s\n", resume_file);
if (read_suspend_image(resume_file, 0))
goto read_failure;
+
+ if (pm_prepare_console())
+ printk("swsusp: Can't allocate a console... proceeding\n");
+
device_suspend(4);
do_magic(1);
panic("This never returns");

read_failure:
- pm_restore_console();
return 0;
}