From: Nathan Fontenot <nfont@austin•ibm.com>
To: Brian King <brking@linux•vnet.ibm.com>
Cc: linuxppc-dev@lists•ozlabs.org
Subject: Re: [PATCH 1/2] powerpc: Partition hibernation support
Date: Thu, 11 Mar 2010 13:59:19 -0600 [thread overview]
Message-ID: <4B994B97.70702@austin.ibm.com> (raw)
In-Reply-To: <201002240002.o1O02OBe031005@d03av05.boulder.ibm.com>
Brian King wrote:
> Enables support for HMC initiated partition hibernation. This is
> a firmware assisted hibernation, since the firmware handles writing
> the memory out to disk, along with other partition information,
> so we just mimic suspend to ram.
>
> Signed-off-by: Brian King <brking@linux•vnet.ibm.com>
> ---
>
> arch/powerpc/Kconfig | 2
> arch/powerpc/include/asm/hvcall.h | 1
> arch/powerpc/include/asm/machdep.h | 1
> arch/powerpc/include/asm/rtas.h | 10 +
> arch/powerpc/kernel/rtas.c | 118 ++++++++++-----
> arch/powerpc/platforms/pseries/Makefile | 1
> arch/powerpc/platforms/pseries/hotplug-cpu.c | 6
> arch/powerpc/platforms/pseries/suspend.c | 209 +++++++++++++++++++++++++++
> 8 files changed, 312 insertions(+), 36 deletions(-)
>
> diff -puN /dev/null arch/powerpc/platforms/pseries/suspend.c
> --- /dev/null 2009-12-15 17:58:07.000000000 -0600
> +++ linux-2.6-bjking1/arch/powerpc/platforms/pseries/suspend.c 2010-02-23 16:29:25.000000000 -0600
> @@ -0,0 +1,209 @@
-- snip --
> +
> +static SYSDEV_ATTR(hibernate, S_IWUSR, NULL, store_hibernate);
> +
> +static struct sysdev_class suspend_sysdev_class = {
> + .name = "power",
> +};
> +
> +static struct platform_suspend_ops pseries_suspend_ops = {
> + .valid = suspend_valid_only_mem,
> + .begin = pseries_suspend_begin,
> + .prepare_late = pseries_prepare_late,
> + .enter = pseries_suspend_enter,
> +};
> +
> +/**
> + * pseries_suspend_sysfs_register - Register with sysfs
> + *
> + * Return value:
> + * 0 on success / other on failure
> + **/
> +static int pseries_suspend_sysfs_register(struct sys_device *sysdev)
> +{
> + int rc;
> +
> + if ((rc = sysdev_class_register(&suspend_sysdev_class)))
> + return rc;
> +
> + sysdev->id = 0;
> + sysdev->cls = &suspend_sysdev_class;
> +
> + if ((rc = sysdev_register(sysdev)))
> + goto class_unregister;
> + if ((rc = sysdev_create_file(sysdev, &attr_hibernate)))
> + goto fail;
> +
Could you just do a sysdev_class_create_file(&suspend_sysdev_class, &attr_hibernate)
call to create the hibernate file instead of the sysdev_register() and
sysdev_create_file()? I think this may make it a bit nicer since the file created
will be /sys/devices/system/power/hibernate instead of
/sys/devices/system/power/power0/hibernate.
-Nathan
> + return 0;
> +
> +fail:
> + sysdev_unregister(sysdev);
> +class_unregister:
> + sysdev_class_unregister(&suspend_sysdev_class);
> + return rc;
> +}
> +
next prev parent reply other threads:[~2010-03-11 19:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-24 0:02 [PATCH 1/2] powerpc: Partition hibernation support Brian King
2010-03-11 19:59 ` Nathan Fontenot [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-05-07 18:58 Brian King
2010-05-10 6:48 ` Michael Ellerman
2010-05-10 14:37 ` Brian King
2010-05-10 20:57 ` Brian King
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=4B994B97.70702@austin.ibm.com \
--to=nfont@austin$(echo .)ibm.com \
--cc=brking@linux$(echo .)vnet.ibm.com \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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