From: Zhang Rui <rui.zhang@intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Linux PM list <linux-pm@vger.kernel.org>,
Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Subject: [PATCH RESEND 2/2] PM: invalidate TEST_CPUS and TEST_CORE support for freeze state
Date: Tue, 12 Mar 2013 09:21:49 +0800 [thread overview]
Message-ID: <1363051309.2291.101.camel@rzhang1-mobl4> (raw)
>From 0777c83233875e2f84c21f76145058f513894abd Mon Sep 17 00:00:00 2001
From: Zhang Rui <rui.zhang@intel.com>
Date: Wed, 6 Mar 2013 21:22:21 +0800
Subject: [PATCH RESEND 2/2] PM: invalidate TEST_CPUS and TEST_CORE support for
freeze state
freeze state is a software suspend state that does not run into
low-level platform callbacks which may interact with BIOS.
And freeze state does not need to disable the processors.
But the current pm_test support misleads users because users
can enter freeze state with pm_test set to TEST_CPUS/TEST_CORE,
while this pm_test setting never takes actions.
So, invalidate TEST_CPUS/TEST_CORE for freeze state in this patch.
Then users will get an error instead, when trying to
enter freeze state with pm_test mode set to TEST_CPUS/TEST_CORE.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
kernel/power/suspend.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 5eb30aa..e29909a 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -76,8 +76,16 @@ EXPORT_SYMBOL_GPL(suspend_set_ops);
bool valid_state(suspend_state_t state)
{
- if (state == PM_SUSPEND_FREEZE)
- return true;
+ if (state == PM_SUSPEND_FREEZE) {
+ if (pm_test_level == TEST_NONE ||
+ pm_test_level == TEST_FREEZER ||
+ pm_test_level == TEST_DEVICES ||
+ pm_test_level == TEST_PLATFORM)
+ return true;
+ printk(KERN_WARNING "Unsupported pm_test mode for freeze state,"
+ " please choose none/freezer/devices/platform.\n");
+ return false;
+ }
/*
* PM_SUSPEND_STANDBY and PM_SUSPEND_MEMORY states need lowlevel
* support and need to be valid to the lowlevel
--
1.7.9.5
next reply other threads:[~2013-03-12 1:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 1:21 Zhang Rui [this message]
-- strict thread matches above, loose matches on Subject: below --
2013-03-27 3:36 [PATCH RESEND 1/2] PM: add TEST_PLATFORM support for freeze state Zhang Rui
2013-03-27 3:36 ` [PATCH RESEND 2/2] PM: invalidate TEST_CPUS and TEST_CORE " Zhang Rui
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=1363051309.2291.101.camel@rzhang1-mobl4 \
--to=rui.zhang@intel.com \
--cc=kristen.c.accardi@intel.com \
--cc=linux-pm@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).