From: Nigel Cunningham <nigel@suspend2.net>
To: linux-kernel@vger.kernel.org
Subject: [Suspend2][ 06/10] [Suspend2] Post-atomic restore routine
Date: Tue, 27 Jun 2006 14:39:07 +1000 [thread overview]
Message-ID: <20060627043905.14546.49973.stgit@nigel.suspend2.net> (raw)
In-Reply-To: <20060627043846.14546.75810.stgit@nigel.suspend2.net>
After doing the atomic restore, we need to restore the values of variables
that were saved at resume time and get the remainder of the image loaded.
At the end of this routine, the contents of memory are virtually the same
as prior to beginning the cycle.
Signed-off-by: Nigel Cunningham <nigel@suspend2.net>
kernel/power/atomic_copy.c | 45 ++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/kernel/power/atomic_copy.c b/kernel/power/atomic_copy.c
index e565bf3..a834623 100644
--- a/kernel/power/atomic_copy.c
+++ b/kernel/power/atomic_copy.c
@@ -217,3 +217,48 @@ void prepare_suspend2_pbe_list(void)
} while (1);
}
+/*
+ * copyback_post: Post atomic-restore actions.
+ *
+ * After doing the atomic restore, we have a few more things to do:
+ * 1) We want to retain some values across the restore, so we now copy
+ * these from the nosave variables to the normal ones.
+ * 2) Set the status flags.
+ * 3) Resume devices.
+ * 4) Get userui to redraw.
+ * 5) Reread the page cache.
+ */
+
+void copyback_post(void)
+{
+ int loop;
+
+ suspend_action = state1;
+ suspend_debug_state = state2;
+ console_loglevel = state3;
+
+ for (loop = 0; loop < 4; loop++)
+ suspend_io_time[loop/2][loop%2] =
+ io_speed_save[loop/2][loop%2];
+
+ set_suspend_state(SUSPEND_NOW_RESUMING);
+ set_suspend_state(SUSPEND_PAGESET2_NOT_LOADED);
+
+ if (pm_ops && pm_ops->finish && suspend_powerdown_method > 3)
+ pm_ops->finish(suspend_powerdown_method);
+
+ if (suspend_activate_storage(1))
+ panic("Failed to reactivate our storage.");
+
+ userui_redraw();
+
+ suspend_cond_pause(1, "About to reload secondary pagedir.");
+
+ if (read_pageset2(0))
+ panic("Unable to successfully reread the page cache.");
+
+ clear_suspend_state(SUSPEND_PAGESET2_NOT_LOADED);
+
+ suspend_prepare_status(DONT_CLEAR_BAR, "Cleaning up...");
+}
+
--
Nigel Cunningham nigel at suspend2 dot net
next prev parent reply other threads:[~2006-06-27 5:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-27 4:38 [Suspend2][ 00/10] Suspend2 Atomic Copy Patches Nigel Cunningham
2006-06-27 4:38 ` [Suspend2][ 01/10] [Suspend2] Atomic copy file header Nigel Cunningham
2006-06-27 4:38 ` [Suspend2][ 02/10] [Suspend2] Initialise nosave zone table Nigel Cunningham
2006-06-27 4:38 ` [Suspend2][ 03/10] [Suspend2] Atomic copy get_next_bit_on routine Nigel Cunningham
2006-06-27 4:39 ` [Suspend2][ 04/10] [Suspend2] Prepare pbe list for atomic restore Nigel Cunningham
2006-06-27 4:39 ` [Suspend2][ 05/10] [Suspend2] Highmem copyback routine Nigel Cunningham
2006-06-27 4:39 ` Nigel Cunningham [this message]
2006-06-27 4:39 ` [Suspend2][ 07/10] [Suspend2] Post suspend context-save routine Nigel Cunningham
2006-06-27 4:39 ` [Suspend2][ 08/10] [Suspend2] Atomic copy routine Nigel Cunningham
2006-06-27 4:39 ` [Suspend2][ 09/10] [Suspend2] Atomic copy highlevel routine Nigel Cunningham
2006-06-27 4:39 ` [Suspend2][ 10/10] [Suspend2] Atomic restore " Nigel Cunningham
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=20060627043905.14546.49973.stgit@nigel.suspend2.net \
--to=nigel@suspend2.net \
--cc=linux-kernel@vger.kernel.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 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®