aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power/power.h
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-11-19 17:41:19 -0500
committerLen Brown <len.brown@intel.com>2008-02-01 18:30:54 -0500
commit0e7d56e3d9d7e37c79d0e05ffb3994e34beb3bbc (patch)
treecac3e72f882085bc869df9302248a079c657bb10 /kernel/power/power.h
parentc3e94d899c864e558f938f9845ddb8c2e5d5ccd0 (diff)
Suspend: Testing facility (rev. 2)
Introduce sysfs attribute /sys/power/pm_test allowing one to test the suspend core code.  Namely, writing one of the strings: freezer devices platform processors core to this file causes the suspend code to work in one of the test modes defined as follows: freezer - test the freezing of processes devices - test the freezing of processes and suspending of devices platform - test the freezing of processes, suspending of devices and platform global   control methods(*) processors - test the freezing of processes, suspending of devices, platform global   control methods and the disabling of nonboot CPUs core - test the freezing of processes, suspending of devices, platform global   control methods, the disabling of nonboot CPUs and suspending of   platform/system devices (*) These are ACPI global control methods on ACPI systems Then, if a suspend is started by normal means, the suspend core will perform its normal operations up to the point indicated by given test level.  Next, it will wait for 5 seconds and carry out the resume operations needed to transition the system back to the fully functional state. Writing "none" to /sys/power/pm_test turns the testing off. When open for reading, /sys/power/pm_test contains a space-separated list of all available tests (including "none" that represents the normal functionality) in which the current test level is indicated by square brackets. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r--kernel/power/power.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h
index c5321eb1f7c8..9f9e16e33962 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -188,3 +188,21 @@ int restore_highmem(void);
188static inline unsigned int count_highmem_pages(void) { return 0; } 188static inline unsigned int count_highmem_pages(void) { return 0; }
189static inline int restore_highmem(void) { return 0; } 189static inline int restore_highmem(void) { return 0; }
190#endif 190#endif
191
192/*
193 * Suspend test levels
194 */
195enum {
196 /* keep first */
197 TEST_NONE,
198 TEST_CORE,
199 TEST_CPUS,
200 TEST_PLATFORM,
201 TEST_DEVICES,
202 TEST_FREEZER,
203 /* keep last */
204 __TEST_AFTER_LAST
205};
206
207#define TEST_FIRST TEST_NONE
208#define TEST_MAX (__TEST_AFTER_LAST - 1)