All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Andrew Morton <akpm@zip.com.au>,
	Patrick Mochel <mochel@digitalimplant.org>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: -mm swsusp: fix highmem handling
Date: Mon, 9 Aug 2004 14:48:26 +0200	[thread overview]
Message-ID: <20040809124825.GA602@elf.ucw.cz> (raw)

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!

             reply	other threads:[~2004-08-09 21:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-09 12:48 Pavel Machek [this message]
2004-08-09 21:47 ` -mm swsusp: fix highmem handling Andrew Morton
2004-08-09 21:52 ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2004-07-28 22:23 Pavel Machek
2004-08-02  6:13 ` Patrick Mochel
2004-08-06 21:11   ` Pavel Machek
2004-08-08 18:53 ` 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=20040809124825.GA602@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@digitalimplant.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.