aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>2011-12-01 16:33:20 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2011-12-06 16:08:14 -0500
commit48580ab8729865c81e148d59159fbe2aa7865511 (patch)
tree40fca721d04bb2ceef8a2e603ba529447cd0fe65
parent97819a26224f019e73d88bb2fd4eb5a614860461 (diff)
PM / Hibernate: Remove deprecated hibernation test modes
The hibernation test modes 'test' and 'testproc' are deprecated, because the 'pm_test' framework offers much more fine-grained control for debugging suspend and hibernation related problems. So, remove the deprecated 'test' and 'testproc' hibernation test modes. Suggested-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r--kernel/power/hibernate.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index c10cb0f916e2..5314a94a92c1 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -43,8 +43,6 @@ int in_suspend __nosavedata;
43enum { 43enum {
44 HIBERNATION_INVALID, 44 HIBERNATION_INVALID,
45 HIBERNATION_PLATFORM, 45 HIBERNATION_PLATFORM,
46 HIBERNATION_TEST,
47 HIBERNATION_TESTPROC,
48 HIBERNATION_SHUTDOWN, 46 HIBERNATION_SHUTDOWN,
49 HIBERNATION_REBOOT, 47 HIBERNATION_REBOOT,
50 /* keep last */ 48 /* keep last */
@@ -96,15 +94,6 @@ static void hibernation_debug_sleep(void)
96 mdelay(5000); 94 mdelay(5000);
97} 95}
98 96
99static int hibernation_testmode(int mode)
100{
101 if (hibernation_mode == mode) {
102 hibernation_debug_sleep();
103 return 1;
104 }
105 return 0;
106}
107
108static int hibernation_test(int level) 97static int hibernation_test(int level)
109{ 98{
110 if (pm_test_level == level) { 99 if (pm_test_level == level) {
@@ -114,7 +103,6 @@ static int hibernation_test(int level)
114 return 0; 103 return 0;
115} 104}
116#else /* !CONFIG_PM_DEBUG */ 105#else /* !CONFIG_PM_DEBUG */
117static int hibernation_testmode(int mode) { return 0; }
118static int hibernation_test(int level) { return 0; } 106static int hibernation_test(int level) { return 0; }
119#endif /* !CONFIG_PM_DEBUG */ 107#endif /* !CONFIG_PM_DEBUG */
120 108
@@ -278,8 +266,7 @@ static int create_image(int platform_mode)
278 goto Platform_finish; 266 goto Platform_finish;
279 267
280 error = disable_nonboot_cpus(); 268 error = disable_nonboot_cpus();
281 if (error || hibernation_test(TEST_CPUS) 269 if (error || hibernation_test(TEST_CPUS))
282 || hibernation_testmode(HIBERNATION_TEST))
283 goto Enable_cpus; 270 goto Enable_cpus;
284 271
285 local_irq_disable(); 272 local_irq_disable();
@@ -349,8 +336,7 @@ int hibernation_snapshot(int platform_mode)
349 if (error) 336 if (error)
350 goto Cleanup; 337 goto Cleanup;
351 338
352 if (hibernation_test(TEST_FREEZER) || 339 if (hibernation_test(TEST_FREEZER)) {
353 hibernation_testmode(HIBERNATION_TESTPROC)) {
354 340
355 /* 341 /*
356 * Indicate to the caller that we are returning due to a 342 * Indicate to the caller that we are returning due to a
@@ -586,9 +572,6 @@ int hibernation_platform_enter(void)
586static void power_down(void) 572static void power_down(void)
587{ 573{
588 switch (hibernation_mode) { 574 switch (hibernation_mode) {
589 case HIBERNATION_TEST:
590 case HIBERNATION_TESTPROC:
591 break;
592 case HIBERNATION_REBOOT: 575 case HIBERNATION_REBOOT:
593 kernel_restart(NULL); 576 kernel_restart(NULL);
594 break; 577 break;
@@ -853,8 +836,6 @@ static const char * const hibernation_modes[] = {
853 [HIBERNATION_PLATFORM] = "platform", 836 [HIBERNATION_PLATFORM] = "platform",
854 [HIBERNATION_SHUTDOWN] = "shutdown", 837 [HIBERNATION_SHUTDOWN] = "shutdown",
855 [HIBERNATION_REBOOT] = "reboot", 838 [HIBERNATION_REBOOT] = "reboot",
856 [HIBERNATION_TEST] = "test",
857 [HIBERNATION_TESTPROC] = "testproc",
858}; 839};
859 840
860/* 841/*
@@ -863,17 +844,15 @@ static const char * const hibernation_modes[] = {
863 * Hibernation can be handled in several ways. There are a few different ways 844 * Hibernation can be handled in several ways. There are a few different ways
864 * to put the system into the sleep state: using the platform driver (e.g. ACPI 845 * to put the system into the sleep state: using the platform driver (e.g. ACPI
865 * or other hibernation_ops), powering it off or rebooting it (for testing 846 * or other hibernation_ops), powering it off or rebooting it (for testing
866 * mostly), or using one of the two available test modes. 847 * mostly).
867 * 848 *
868 * The sysfs file /sys/power/disk provides an interface for selecting the 849 * The sysfs file /sys/power/disk provides an interface for selecting the
869 * hibernation mode to use. Reading from this file causes the available modes 850 * hibernation mode to use. Reading from this file causes the available modes
870 * to be printed. There are 5 modes that can be supported: 851 * to be printed. There are 3 modes that can be supported:
871 * 852 *
872 * 'platform' 853 * 'platform'
873 * 'shutdown' 854 * 'shutdown'
874 * 'reboot' 855 * 'reboot'
875 * 'test'
876 * 'testproc'
877 * 856 *
878 * If a platform hibernation driver is in use, 'platform' will be supported 857 * If a platform hibernation driver is in use, 'platform' will be supported
879 * and will be used by default. Otherwise, 'shutdown' will be used by default. 858 * and will be used by default. Otherwise, 'shutdown' will be used by default.
@@ -897,8 +876,6 @@ static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr,
897 switch (i) { 876 switch (i) {
898 case HIBERNATION_SHUTDOWN: 877 case HIBERNATION_SHUTDOWN:
899 case HIBERNATION_REBOOT: 878 case HIBERNATION_REBOOT:
900 case HIBERNATION_TEST:
901 case HIBERNATION_TESTPROC:
902 break; 879 break;
903 case HIBERNATION_PLATFORM: 880 case HIBERNATION_PLATFORM:
904 if (hibernation_ops) 881 if (hibernation_ops)
@@ -939,8 +916,6 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr,
939 switch (mode) { 916 switch (mode) {
940 case HIBERNATION_SHUTDOWN: 917 case HIBERNATION_SHUTDOWN:
941 case HIBERNATION_REBOOT: 918 case HIBERNATION_REBOOT:
942 case HIBERNATION_TEST:
943 case HIBERNATION_TESTPROC:
944 hibernation_mode = mode; 919 hibernation_mode = mode;
945 break; 920 break;
946 case HIBERNATION_PLATFORM: 921 case HIBERNATION_PLATFORM: