From: "Huang, Ying" <ying.huang@intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Pavel Machek <pavel@ucw.cz>,
nigel@nigel.suspend2.net,
Andrew Morton <akpm@linux-foundation.org>,
Jeremy Maitin-Shepard <jbms@cmu.edu>,
linux-kernel@vger.kernel.org,
linux-pm@lists.linux-foundation.org,
Kexec Mailing List <kexec@lists.infradead.org>
Subject: Re: [PATCH 3/3 -mm] kexec based hibernation -v6: kexec hibernate/resume
Date: Tue, 20 Nov 2007 10:50:33 +0800 [thread overview]
Message-ID: <1195527033.11955.50.camel@caritas-dev.intel.com> (raw)
In-Reply-To: <200711200324.31180.rjw@sisk.pl>
On Tue, 2007-11-20 at 03:24 +0100, Rafael J. Wysocki wrote:
> On Tuesday, 20 of November 2007, Huang, Ying wrote:
> > On Mon, 2007-11-19 at 19:22 +0100, Rafael J. Wysocki wrote:
> > > > +#ifdef CONFIG_KEXEC
> > > > +static void kexec_hibernate_power_down(void)
> > > > +{
> > > > + switch (hibernation_mode) {
> > > > + case HIBERNATION_TEST:
> > > > + case HIBERNATION_TESTPROC:
> > > > + break;
> > > > + case HIBERNATION_REBOOT:
> > > > + machine_restart(NULL);
> > > > + break;
> > > > + case HIBERNATION_PLATFORM:
> > > > + if (!hibernation_ops)
> > > > + break;
> > > > + hibernation_ops->enter();
> > >
> > > hibernation_platform_enter() should be used here (as of the current mainline).
> >
> > The power_down will be called with interrupt disabled, device suspended,
> > non-boot CPU disabled. But the latest hibernate_platform_enter calls the
> > device_suspend, disable_nonboot_cpus etc function. So, I use
> > hibernation_ops->enter() directly instead of
> > hibernation_platform_enter().
>
> Hm, you need to call device_power_down(PMSG_SUSPEND) before
> hibernation_ops->enter().
>
> Also, all of the ACPI global calls need to be carried out before that and the
> devices should be suspended rather than shut down in that case.
>
> That's why hibernation_platform_enter() has been introduced, BTW.
Situation is a little different between u/swsusp and khiberantion.
u/swsusp:
platform_start();
suspend console();
device_suspend(PMSG_FREEZE);
platform_pre_snapshot();
disable_nonboot_cpus();
local_irq_disable();
device_power_down(PMSG_FREEZE);
/* create snapshot */
device_power_up();
local_irq_enable();
enable_nonboot_cpus();
platform_finish();
device_resume();
resume_console();
/* write the image out */
hibernation_ops->start();
suspend_console();
device_suspend(PMSG_SUSPEND);
hibernation_ops->prepare();
disable_nonboot_cpus();
local_irq_disable();
device_power_down(PMSG_SUSPEND);
hibernation_ops->enter();
khibernation:
suspend_console();
platform_start();
device_suspend(PMSG_FREEZE);
platform_pre_snapshot();
disable_nonboot_cpus();
local_irq_disable();
device_power_down(PMSG_FREEZE);
/* jump to kexeced (hibernating) kernel */
/* in kexeced kernel */
device_power_up();
local_irq_eanble();
enable_nonboot_cpus();
device_resume();
resume_console();
/* write the image */
suspend_console();
device_suspend(PMSG_FREEZE);
disable_nonboot_cpus();
local_irq_disable();
device_power_down(PMSG_FREEZE);
/* jump to original (hibernated) kernel */
/* in original kernel */
hibernation_ops->enter();
The difference is:
- In u/swsusp, ACPI methods are executed twice, before writing out the
image and after writing out the image.
- After writing out the image, the PMSG_SUSPEND is used instead of
PMSG_FREEZE.
Some questions:
- What is the difference between PMSG_SUSPEND and PMSG_FREEZE?
- The ACPI methods should be executed once or twice? According to ACPI
specification?
Best Regards,
Huang Ying
next prev parent reply other threads:[~2007-11-20 2:49 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-19 7:02 [PATCH 3/3 -mm] kexec based hibernation -v6: kexec hibernate/resume Huang, Ying
2007-11-19 18:22 ` Rafael J. Wysocki
2007-11-20 1:56 ` Huang, Ying
2007-11-20 2:24 ` Rafael J. Wysocki
2007-11-20 2:50 ` Huang, Ying [this message]
2007-11-20 14:58 ` [linux-pm] " Alan Stern
2007-11-21 0:00 ` Rafael J. Wysocki
2007-11-21 0:00 ` Rafael J. Wysocki
2007-11-21 8:05 ` Huang, Ying
2007-11-21 20:09 ` Rafael J. Wysocki
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=1195527033.11955.50.camel@caritas-dev.intel.com \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=jbms@cmu.edu \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=nigel@nigel.suspend2.net \
--cc=pavel@ucw.cz \
--cc=rjw@sisk.pl \
/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