public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make pmdisk suspend more reliable
@ 2003-10-12 16:18 Tony Lindgren
  2003-10-12 18:07 ` Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2003-10-12 16:18 UTC (permalink / raw)
  To: linux-kernel; +Cc: mochel

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

Hi Patrick & all,

Here's a little patch to make pmdisk suspend to disk work on my old
laptop. Basically at least the PMDISK_SIG never got to the disk, and
finding the suspend image would fail without this patch. The patch is
against linux-2.6.0-test7.

Pls cc me on any replies, I'm not on the list right now.

Regards,

Tony



[-- Attachment #2: pmdisk-bdflush.patch --]
[-- Type: text/plain, Size: 560 bytes --]

--- linux-2.6.0-test7/kernel/power/pmdisk.c-orig	2003-10-12 18:35:58.000000000 +0300
+++ linux-2.6.0-test7/kernel/power/pmdisk.c	2003-10-12 19:00:32.000000000 +0300
@@ -35,6 +35,7 @@
 
 
 extern int pmdisk_arch_suspend(int resume);
+extern int wakeup_bdflush(long nr_pages);
 
 #define __ADDRESS(x)  ((unsigned long) phys_to_virt(x))
 #define ADDRESS(x) __ADDRESS((x) << PAGE_SHIFT)
@@ -372,6 +373,9 @@
 		goto FreePagedir;
 
 	error = mark_swapfiles(prev);
+
+	/* Make sure the data gets to disk */
+	wakeup_bdflush(0);
  Done:
 	return error;
  FreePagedir:

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

* Re: [PATCH] Make pmdisk suspend more reliable
  2003-10-12 16:18 [PATCH] Make pmdisk suspend more reliable Tony Lindgren
@ 2003-10-12 18:07 ` Sam Ravnborg
  2003-10-14 15:19   ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2003-10-12 18:07 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-kernel, mochel

On Sun, Oct 12, 2003 at 09:18:28AM -0700, Tony Lindgren wrote:

> --- linux-2.6.0-test7/kernel/power/pmdisk.c-orig	2003-10-12 18:35:58.000000000 +0300
> +++ linux-2.6.0-test7/kernel/power/pmdisk.c	2003-10-12 19:00:32.000000000 +0300
> @@ -35,6 +35,7 @@
>  
>  
>  extern int pmdisk_arch_suspend(int resume);
> +extern int wakeup_bdflush(long nr_pages);

Prototypes in .c files is never a good idea.
wakeup_bdflush is prototyped in include/linux/writeback.h

pmdisk_arch_suspend is expected to be implemented in assembler, which
explain why it is prototypes locally.

	Sam

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

* Re: [PATCH] Make pmdisk suspend more reliable
  2003-10-12 18:07 ` Sam Ravnborg
@ 2003-10-14 15:19   ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2003-10-14 15:19 UTC (permalink / raw)
  To: linux-kernel, mochel

Hi,

* Sam Ravnborg <sam@ravnborg.org> [031012 11:07]:
> On Sun, Oct 12, 2003 at 09:18:28AM -0700, Tony Lindgren wrote:
> 
> >  extern int pmdisk_arch_suspend(int resume);
> > +extern int wakeup_bdflush(long nr_pages);
> 
> Prototypes in .c files is never a good idea.
> wakeup_bdflush is prototyped in include/linux/writeback.h

I guess you mean to #include <linux/writeback.h> instead of extern, or
did I misunderstand what you meant?

There may be more to the suspend image not getting to the disk besides
flushing, I'm now wondering if it works with IDE DMA enabled, but not
without DMA. I'll try to investigate it a bit further.

Tony

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

end of thread, other threads:[~2003-10-14 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-10-12 16:18 [PATCH] Make pmdisk suspend more reliable Tony Lindgren
2003-10-12 18:07 ` Sam Ravnborg
2003-10-14 15:19   ` Tony Lindgren

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