public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel/power/swsusp.c
@ 2004-07-03 17:28 Erik Rigtorp
  2004-07-03 20:46 ` Pavel Machek
  0 siblings, 1 reply; 8+ messages in thread
From: Erik Rigtorp @ 2004-07-03 17:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: pavel

Swsusp allocates a vt before it nows if it will need it. This interferes
with bootsplash. Here is a patch that moves the pm_prepare_console() call
so that its only executed if swsusp finds a valid image to resume.

diff -Nru linux-2.6.7/kernel/power/swsusp.c linux-2.6.7-swsusp/kernel/power/swsusp.c
--- linux-2.6.7/kernel/power/swsusp.c	2004-06-16 07:19:02.000000000 +0200
+++ linux-2.6.7-swsusp/kernel/power/swsusp.c	2004-07-03 19:01:28.000000000 +0200
@@ -1067,6 +1069,9 @@
 	printk( "%sSignature found, resuming\n", name_resume );
 	MDELAY(1000);
 
+   	if (pm_prepare_console())
+		printk("swsusp: Can't allocate a console... proceeding\n");
+   
 	if (bdev_read_page(bdev, next.val, cur)) return -EIO;
 	if (sanity_check(&cur->sh)) 	/* Is this same machine? */	
 		return -EPERM;
@@ -1190,9 +1195,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;
@@ -1206,7 +1208,6 @@
 	panic("This never returns");
 
 read_failure:
-	pm_restore_console();
 	return 0;
 }

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kernel/power/swsusp.c
  2004-07-03 17:28 [PATCH] kernel/power/swsusp.c Erik Rigtorp
@ 2004-07-03 20:46 ` Pavel Machek
  2004-07-04 11:49   ` Erik Rigtorp
  2004-07-04 13:37   ` Erik Rigtorp
  0 siblings, 2 replies; 8+ messages in thread
From: Pavel Machek @ 2004-07-03 20:46 UTC (permalink / raw)
  To: Erik Rigtorp; +Cc: linux-kernel

Hi!

> Swsusp allocates a vt before it nows if it will need it. This interferes
> with bootsplash. Here is a patch that moves the pm_prepare_console() call
> so that its only executed if swsusp finds a valid image to resume.

You are moving it inside function that should have no business doing
this... Would something like this work better? [hand-edited, apply by
hand; untested].

BTW is bootsplash actually used by suse and/or redhat? Suse certainly
has some splashscreen... Perhaps some splash support into swsusp (as
an add on) would be good idea, but it would be good to only code it
once.
								Pavel

--- clean/kernel/power/swsusp.c	2004-06-22 12:36:47.000000000 +0200
+++ linux/kernel/power/swsusp.c	2004-07-03 22:40:47.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,17 @@
 	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;
 }
 



-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kernel/power/swsusp.c
  2004-07-03 20:46 ` Pavel Machek
@ 2004-07-04 11:49   ` Erik Rigtorp
  2004-07-04 22:50     ` Nigel Cunningham
  2004-07-04 13:37   ` Erik Rigtorp
  1 sibling, 1 reply; 8+ messages in thread
From: Erik Rigtorp @ 2004-07-04 11:49 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel

On Sat, Jul 03, 2004 at 10:46:47PM +0200, Pavel Machek wrote:
> You are moving it inside function that should have no business doing
> this... Would something like this work better? [hand-edited, apply by
> hand; untested].
I'll try it.

> BTW is bootsplash actually used by suse and/or redhat? Suse certainly
Suse uses bootsplash. Even without bootsplash the console jumps to a new vc
then back at every boot, on systems with bootsplash and/or slow systems this
causes the screen to flicker.

> has some splashscreen... Perhaps some splash support into swsusp (as
> an add on) would be good idea, but it would be good to only code it
> once.
That is infact my intention. I've looked some at the swsusp2 code but it
looks ugly. My plan is to create a general kernel level interface to
bootsplash, then add hooks in swsusp. This code should probably live in the
bootsplash patch.

Erik

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kernel/power/swsusp.c
  2004-07-03 20:46 ` Pavel Machek
  2004-07-04 11:49   ` Erik Rigtorp
@ 2004-07-04 13:37   ` Erik Rigtorp
  2004-07-04 15:18     ` Pavel Machek
  1 sibling, 1 reply; 8+ messages in thread
From: Erik Rigtorp @ 2004-07-04 13:37 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel

On Sat, Jul 03, 2004 at 10:46:47PM +0200, Pavel Machek wrote:
> You are moving it inside function that should have no business doing
> this... Would something like this work better? [hand-edited, apply by
> hand; untested].

Your patch works fine but now the swsusp resume messages appears on the
normal console instead. The swsusp console should be allocated earlier as my
patch did.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kernel/power/swsusp.c
  2004-07-04 13:37   ` Erik Rigtorp
@ 2004-07-04 15:18     ` Pavel Machek
  2004-07-05 10:54       ` Erik Rigtorp
  0 siblings, 1 reply; 8+ messages in thread
From: Pavel Machek @ 2004-07-04 15:18 UTC (permalink / raw)
  To: Erik Rigtorp; +Cc: linux-kernel

Hi!

> > You are moving it inside function that should have no business doing
> > this... Would something like this work better? [hand-edited, apply by
> > hand; untested].
> 
> Your patch works fine but now the swsusp resume messages appears on the
> normal console instead. The swsusp console should be allocated earlier as my
> patch did.

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...

								Pavel
-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kernel/power/swsusp.c
  2004-07-04 11:49   ` Erik Rigtorp
@ 2004-07-04 22:50     ` Nigel Cunningham
  0 siblings, 0 replies; 8+ messages in thread
From: Nigel Cunningham @ 2004-07-04 22:50 UTC (permalink / raw)
  To: Erik Rigtorp; +Cc: Pavel Machek, Linux Kernel Mailing List

Hi.

On Sun, 2004-07-04 at 21:49, Erik Rigtorp wrote:
> That is infact my intention. I've looked some at the swsusp2 code but it
> looks ugly. My plan is to create a general kernel level interface to
> bootsplash, then add hooks in swsusp. This code should probably live in the
> bootsplash patch.

Yes. I'd love a better in kernel interface. Could you make it so that
for an arbitrary vt, we easily detect if bootsplash is on, switch
between silent and verbose and set the progress bar value?

Regards,

Nigel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kernel/power/swsusp.c
  2004-07-04 15:18     ` Pavel Machek
@ 2004-07-05 10:54       ` Erik Rigtorp
  2004-07-05 15:13         ` Pavel Machek
  0 siblings, 1 reply; 8+ messages in thread
From: Erik Rigtorp @ 2004-07-05 10:54 UTC (permalink / raw)
  To: Pavel Machek; +Cc: linux-kernel

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

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.

[-- Attachment #2: swsusp-alloc-console-later.patch --]
[-- Type: text/plain, Size: 858 bytes --]

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;
 }
 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] kernel/power/swsusp.c
  2004-07-05 10:54       ` Erik Rigtorp
@ 2004-07-05 15:13         ` Pavel Machek
  0 siblings, 0 replies; 8+ messages in thread
From: Pavel Machek @ 2004-07-05 15:13 UTC (permalink / raw)
  To: Erik Rigtorp; +Cc: linux-kernel

Hi!

> 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.

Thanks. I applied equivalent patch to my tree, and it will eventually
propagate. This probably does not apply to latest -bk kernel. If it
does, you can send it to akpm and say that I approved it.

								Pavel

> 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;
>  }
>  


-- 
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-07-05 15:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-03 17:28 [PATCH] kernel/power/swsusp.c Erik Rigtorp
2004-07-03 20:46 ` Pavel Machek
2004-07-04 11:49   ` Erik Rigtorp
2004-07-04 22:50     ` Nigel Cunningham
2004-07-04 13:37   ` Erik Rigtorp
2004-07-04 15:18     ` Pavel Machek
2004-07-05 10:54       ` Erik Rigtorp
2004-07-05 15:13         ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox