mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* -mm swsusp: fix highmem handling
@ 2004-07-28 22:23 Pavel Machek
  2004-08-02  6:13 ` Patrick Mochel
  2004-08-08 18:53 ` Pavel Machek
  0 siblings, 2 replies; 7+ messages in thread
From: Pavel Machek @ 2004-07-28 22:23 UTC (permalink / raw)
  To: Patrick Mochel, kernel list

Hi!

Swsusp was not restoring highmem properly. I did not find a nice place
where to restore it, through, so it went to swsusp_free.

I'm not sure why you are saving state before
save_processor_state. swsusp_arch_resume will overwrite this,
anyway. Is it to make something balanced?
								Pavel

--- clean-mm/kernel/power/swsusp.c	2004-07-28 23:39:49.000000000 +0200
+++ linux-mm/kernel/power/swsusp.c	2004-07-28 23:30:33.000000000 +0200
@@ -656,6 +652,10 @@
 			free_suspend_pagedir_zone(zone, p);
 	}
 	free_pages(p, pagedir_order);
+#ifdef CONFIG_HIGHMEM
+	printk( "Restoring highmem\n" );
+	restore_highmem();
+#endif
 }
 
 
@@ -890,7 +890,6 @@
 {
 	int error;
 	local_irq_disable();
-	save_processor_state();
 	error = swsusp_arch_resume();
 	restore_processor_state();
 	local_irq_enable();

-- 
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] 7+ messages in thread
* -mm swsusp: fix highmem handling
@ 2004-08-09 12:48 Pavel Machek
  2004-08-09 21:47 ` Andrew Morton
  2004-08-09 21:52 ` Andrew Morton
  0 siblings, 2 replies; 7+ messages in thread
From: Pavel Machek @ 2004-08-09 12:48 UTC (permalink / raw)
  To: Andrew Morton, Patrick Mochel, kernel list

Hi!

This fixes highmem handling, and adds some comments so that others do
not fall into the same trap I fallen in: code does not continue below
swsusp_arch_resume if things go okay.

Please apply,
								Pavel

--- clean-mm/kernel/power/swsusp.c	2004-07-28 23:39:49.000000000 +0200
+++ linux-mm/kernel/power/swsusp.c	2004-08-09 11:54:04.000000000 +0200
@@ -870,8 +866,12 @@
 	local_irq_disable();
 	save_processor_state();
 	error = swsusp_arch_suspend();
+	/* Restore control flow magically appears here */
 	restore_processor_state();
 	local_irq_enable();
+#ifdef CONFIG_HIGHMEM
+	restore_highmem();
+#endif
 	return error;
 }
 
@@ -890,8 +889,12 @@
 {
 	int error;
 	local_irq_disable();
 	save_processor_state();
 	error = swsusp_arch_resume();
+	/* Code below is only ever reached in case of failure. Otherwise
+	 * execution continues at place where swsusp_arch_suspend was called
+         */
+	BUG_ON(!error);
 	restore_processor_state();
 	local_irq_enable();
 	return error;



-- 
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] 7+ messages in thread

end of thread, other threads:[~2004-08-09 21:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-28 22:23 -mm swsusp: fix highmem handling Pavel Machek
2004-08-02  6:13 ` Patrick Mochel
2004-08-06 21:11   ` Pavel Machek
2004-08-08 18:53 ` Pavel Machek
2004-08-09 12:48 Pavel Machek
2004-08-09 21:47 ` Andrew Morton
2004-08-09 21:52 ` Andrew Morton

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

all inboxes | Powered by JetHome®