mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] PM / Hibernation: Remove deprecated hibernation test modes
@ 2011-12-01 14:20 Srivatsa S. Bhat
  2011-12-01 21:53 ` Rafael J. Wysocki
  2011-12-02 19:31 ` Pavel Machek
  0 siblings, 2 replies; 3+ messages in thread
From: Srivatsa S. Bhat @ 2011-12-01 14:20 UTC (permalink / raw)
  To: rjw; +Cc: pavel, len.brown, linux-kernel, linux-pm

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>
---

 kernel/power/hibernate.c |   33 ++++-----------------------------
 1 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 80c2d90..68c278b 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -43,8 +43,6 @@ int in_suspend __nosavedata;
 enum {
 	HIBERNATION_INVALID,
 	HIBERNATION_PLATFORM,
-	HIBERNATION_TEST,
-	HIBERNATION_TESTPROC,
 	HIBERNATION_SHUTDOWN,
 	HIBERNATION_REBOOT,
 	/* keep last */
@@ -96,15 +94,6 @@ static void hibernation_debug_sleep(void)
 	mdelay(5000);
 }
 
-static int hibernation_testmode(int mode)
-{
-	if (hibernation_mode == mode) {
-		hibernation_debug_sleep();
-		return 1;
-	}
-	return 0;
-}
-
 static int hibernation_test(int level)
 {
 	if (pm_test_level == level) {
@@ -114,7 +103,6 @@ static int hibernation_test(int level)
 	return 0;
 }
 #else /* !CONFIG_PM_DEBUG */
-static int hibernation_testmode(int mode) { return 0; }
 static int hibernation_test(int level) { return 0; }
 #endif /* !CONFIG_PM_DEBUG */
 
@@ -278,8 +266,7 @@ static int create_image(int platform_mode)
 		goto Platform_finish;
 
 	error = disable_nonboot_cpus();
-	if (error || hibernation_test(TEST_CPUS)
-	    || hibernation_testmode(HIBERNATION_TEST))
+	if (error || hibernation_test(TEST_CPUS))
 		goto Enable_cpus;
 
 	local_irq_disable();
@@ -349,8 +336,7 @@ int hibernation_snapshot(int platform_mode)
 	if (error)
 		goto Cleanup;
 
-	if (hibernation_test(TEST_FREEZER) ||
-		hibernation_testmode(HIBERNATION_TESTPROC)) {
+	if (hibernation_test(TEST_FREEZER)) {
 
 		/*
 		 * Indicate to the caller that we are returning due to a
@@ -586,9 +572,6 @@ int hibernation_platform_enter(void)
 static void power_down(void)
 {
 	switch (hibernation_mode) {
-	case HIBERNATION_TEST:
-	case HIBERNATION_TESTPROC:
-		break;
 	case HIBERNATION_REBOOT:
 		kernel_restart(NULL);
 		break;
@@ -840,8 +823,6 @@ static const char * const hibernation_modes[] = {
 	[HIBERNATION_PLATFORM]	= "platform",
 	[HIBERNATION_SHUTDOWN]	= "shutdown",
 	[HIBERNATION_REBOOT]	= "reboot",
-	[HIBERNATION_TEST]	= "test",
-	[HIBERNATION_TESTPROC]	= "testproc",
 };
 
 /*
@@ -850,17 +831,15 @@ static const char * const hibernation_modes[] = {
  * Hibernation can be handled in several ways.  There are a few different ways
  * to put the system into the sleep state: using the platform driver (e.g. ACPI
  * or other hibernation_ops), powering it off or rebooting it (for testing
- * mostly), or using one of the two available test modes.
+ * mostly).
  *
  * The sysfs file /sys/power/disk provides an interface for selecting the
  * hibernation mode to use.  Reading from this file causes the available modes
- * to be printed.  There are 5 modes that can be supported:
+ * to be printed.  There are 3 modes that can be supported:
  *
  *	'platform'
  *	'shutdown'
  *	'reboot'
- *	'test'
- *	'testproc'
  *
  * If a platform hibernation driver is in use, 'platform' will be supported
  * and will be used by default.  Otherwise, 'shutdown' will be used by default.
@@ -884,8 +863,6 @@ static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr,
 		switch (i) {
 		case HIBERNATION_SHUTDOWN:
 		case HIBERNATION_REBOOT:
-		case HIBERNATION_TEST:
-		case HIBERNATION_TESTPROC:
 			break;
 		case HIBERNATION_PLATFORM:
 			if (hibernation_ops)
@@ -926,8 +903,6 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr,
 		switch (mode) {
 		case HIBERNATION_SHUTDOWN:
 		case HIBERNATION_REBOOT:
-		case HIBERNATION_TEST:
-		case HIBERNATION_TESTPROC:
 			hibernation_mode = mode;
 			break;
 		case HIBERNATION_PLATFORM:


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PM / Hibernation: Remove deprecated hibernation test modes
  2011-12-01 14:20 [PATCH] PM / Hibernation: Remove deprecated hibernation test modes Srivatsa S. Bhat
@ 2011-12-01 21:53 ` Rafael J. Wysocki
  2011-12-02 19:31 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2011-12-01 21:53 UTC (permalink / raw)
  To: Srivatsa S. Bhat; +Cc: pavel, len.brown, linux-kernel, linux-pm

On Thursday, December 01, 2011, Srivatsa S. Bhat wrote:
> 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>

Applied to linux-pm/linux-next.

Thanks,
Rafael


> ---
> 
>  kernel/power/hibernate.c |   33 ++++-----------------------------
>  1 files changed, 4 insertions(+), 29 deletions(-)
> 
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index 80c2d90..68c278b 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -43,8 +43,6 @@ int in_suspend __nosavedata;
>  enum {
>  	HIBERNATION_INVALID,
>  	HIBERNATION_PLATFORM,
> -	HIBERNATION_TEST,
> -	HIBERNATION_TESTPROC,
>  	HIBERNATION_SHUTDOWN,
>  	HIBERNATION_REBOOT,
>  	/* keep last */
> @@ -96,15 +94,6 @@ static void hibernation_debug_sleep(void)
>  	mdelay(5000);
>  }
>  
> -static int hibernation_testmode(int mode)
> -{
> -	if (hibernation_mode == mode) {
> -		hibernation_debug_sleep();
> -		return 1;
> -	}
> -	return 0;
> -}
> -
>  static int hibernation_test(int level)
>  {
>  	if (pm_test_level == level) {
> @@ -114,7 +103,6 @@ static int hibernation_test(int level)
>  	return 0;
>  }
>  #else /* !CONFIG_PM_DEBUG */
> -static int hibernation_testmode(int mode) { return 0; }
>  static int hibernation_test(int level) { return 0; }
>  #endif /* !CONFIG_PM_DEBUG */
>  
> @@ -278,8 +266,7 @@ static int create_image(int platform_mode)
>  		goto Platform_finish;
>  
>  	error = disable_nonboot_cpus();
> -	if (error || hibernation_test(TEST_CPUS)
> -	    || hibernation_testmode(HIBERNATION_TEST))
> +	if (error || hibernation_test(TEST_CPUS))
>  		goto Enable_cpus;
>  
>  	local_irq_disable();
> @@ -349,8 +336,7 @@ int hibernation_snapshot(int platform_mode)
>  	if (error)
>  		goto Cleanup;
>  
> -	if (hibernation_test(TEST_FREEZER) ||
> -		hibernation_testmode(HIBERNATION_TESTPROC)) {
> +	if (hibernation_test(TEST_FREEZER)) {
>  
>  		/*
>  		 * Indicate to the caller that we are returning due to a
> @@ -586,9 +572,6 @@ int hibernation_platform_enter(void)
>  static void power_down(void)
>  {
>  	switch (hibernation_mode) {
> -	case HIBERNATION_TEST:
> -	case HIBERNATION_TESTPROC:
> -		break;
>  	case HIBERNATION_REBOOT:
>  		kernel_restart(NULL);
>  		break;
> @@ -840,8 +823,6 @@ static const char * const hibernation_modes[] = {
>  	[HIBERNATION_PLATFORM]	= "platform",
>  	[HIBERNATION_SHUTDOWN]	= "shutdown",
>  	[HIBERNATION_REBOOT]	= "reboot",
> -	[HIBERNATION_TEST]	= "test",
> -	[HIBERNATION_TESTPROC]	= "testproc",
>  };
>  
>  /*
> @@ -850,17 +831,15 @@ static const char * const hibernation_modes[] = {
>   * Hibernation can be handled in several ways.  There are a few different ways
>   * to put the system into the sleep state: using the platform driver (e.g. ACPI
>   * or other hibernation_ops), powering it off or rebooting it (for testing
> - * mostly), or using one of the two available test modes.
> + * mostly).
>   *
>   * The sysfs file /sys/power/disk provides an interface for selecting the
>   * hibernation mode to use.  Reading from this file causes the available modes
> - * to be printed.  There are 5 modes that can be supported:
> + * to be printed.  There are 3 modes that can be supported:
>   *
>   *	'platform'
>   *	'shutdown'
>   *	'reboot'
> - *	'test'
> - *	'testproc'
>   *
>   * If a platform hibernation driver is in use, 'platform' will be supported
>   * and will be used by default.  Otherwise, 'shutdown' will be used by default.
> @@ -884,8 +863,6 @@ static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr,
>  		switch (i) {
>  		case HIBERNATION_SHUTDOWN:
>  		case HIBERNATION_REBOOT:
> -		case HIBERNATION_TEST:
> -		case HIBERNATION_TESTPROC:
>  			break;
>  		case HIBERNATION_PLATFORM:
>  			if (hibernation_ops)
> @@ -926,8 +903,6 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr,
>  		switch (mode) {
>  		case HIBERNATION_SHUTDOWN:
>  		case HIBERNATION_REBOOT:
> -		case HIBERNATION_TEST:
> -		case HIBERNATION_TESTPROC:
>  			hibernation_mode = mode;
>  			break;
>  		case HIBERNATION_PLATFORM:
> 
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] PM / Hibernation: Remove deprecated hibernation test modes
  2011-12-01 14:20 [PATCH] PM / Hibernation: Remove deprecated hibernation test modes Srivatsa S. Bhat
  2011-12-01 21:53 ` Rafael J. Wysocki
@ 2011-12-02 19:31 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2011-12-02 19:31 UTC (permalink / raw)
  To: Srivatsa S. Bhat; +Cc: rjw, len.brown, linux-kernel, linux-pm

> 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>

ACK.


> ---
> 
>  kernel/power/hibernate.c |   33 ++++-----------------------------
>  1 files changed, 4 insertions(+), 29 deletions(-)
> 
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index 80c2d90..68c278b 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -43,8 +43,6 @@ int in_suspend __nosavedata;
>  enum {
>  	HIBERNATION_INVALID,
>  	HIBERNATION_PLATFORM,
> -	HIBERNATION_TEST,
> -	HIBERNATION_TESTPROC,
>  	HIBERNATION_SHUTDOWN,
>  	HIBERNATION_REBOOT,
>  	/* keep last */
> @@ -96,15 +94,6 @@ static void hibernation_debug_sleep(void)
>  	mdelay(5000);
>  }
>  
> -static int hibernation_testmode(int mode)
> -{
> -	if (hibernation_mode == mode) {
> -		hibernation_debug_sleep();
> -		return 1;
> -	}
> -	return 0;
> -}
> -
>  static int hibernation_test(int level)
>  {
>  	if (pm_test_level == level) {
> @@ -114,7 +103,6 @@ static int hibernation_test(int level)
>  	return 0;
>  }
>  #else /* !CONFIG_PM_DEBUG */
> -static int hibernation_testmode(int mode) { return 0; }
>  static int hibernation_test(int level) { return 0; }
>  #endif /* !CONFIG_PM_DEBUG */
>  
> @@ -278,8 +266,7 @@ static int create_image(int platform_mode)
>  		goto Platform_finish;
>  
>  	error = disable_nonboot_cpus();
> -	if (error || hibernation_test(TEST_CPUS)
> -	    || hibernation_testmode(HIBERNATION_TEST))
> +	if (error || hibernation_test(TEST_CPUS))
>  		goto Enable_cpus;
>  
>  	local_irq_disable();
> @@ -349,8 +336,7 @@ int hibernation_snapshot(int platform_mode)
>  	if (error)
>  		goto Cleanup;
>  
> -	if (hibernation_test(TEST_FREEZER) ||
> -		hibernation_testmode(HIBERNATION_TESTPROC)) {
> +	if (hibernation_test(TEST_FREEZER)) {
>  
>  		/*
>  		 * Indicate to the caller that we are returning due to a
> @@ -586,9 +572,6 @@ int hibernation_platform_enter(void)
>  static void power_down(void)
>  {
>  	switch (hibernation_mode) {
> -	case HIBERNATION_TEST:
> -	case HIBERNATION_TESTPROC:
> -		break;
>  	case HIBERNATION_REBOOT:
>  		kernel_restart(NULL);
>  		break;
> @@ -840,8 +823,6 @@ static const char * const hibernation_modes[] = {
>  	[HIBERNATION_PLATFORM]	= "platform",
>  	[HIBERNATION_SHUTDOWN]	= "shutdown",
>  	[HIBERNATION_REBOOT]	= "reboot",
> -	[HIBERNATION_TEST]	= "test",
> -	[HIBERNATION_TESTPROC]	= "testproc",
>  };
>  
>  /*
> @@ -850,17 +831,15 @@ static const char * const hibernation_modes[] = {
>   * Hibernation can be handled in several ways.  There are a few different ways
>   * to put the system into the sleep state: using the platform driver (e.g. ACPI
>   * or other hibernation_ops), powering it off or rebooting it (for testing
> - * mostly), or using one of the two available test modes.
> + * mostly).
>   *
>   * The sysfs file /sys/power/disk provides an interface for selecting the
>   * hibernation mode to use.  Reading from this file causes the available modes
> - * to be printed.  There are 5 modes that can be supported:
> + * to be printed.  There are 3 modes that can be supported:
>   *
>   *	'platform'
>   *	'shutdown'
>   *	'reboot'
> - *	'test'
> - *	'testproc'
>   *
>   * If a platform hibernation driver is in use, 'platform' will be supported
>   * and will be used by default.  Otherwise, 'shutdown' will be used by default.
> @@ -884,8 +863,6 @@ static ssize_t disk_show(struct kobject *kobj, struct kobj_attribute *attr,
>  		switch (i) {
>  		case HIBERNATION_SHUTDOWN:
>  		case HIBERNATION_REBOOT:
> -		case HIBERNATION_TEST:
> -		case HIBERNATION_TESTPROC:
>  			break;
>  		case HIBERNATION_PLATFORM:
>  			if (hibernation_ops)
> @@ -926,8 +903,6 @@ static ssize_t disk_store(struct kobject *kobj, struct kobj_attribute *attr,
>  		switch (mode) {
>  		case HIBERNATION_SHUTDOWN:
>  		case HIBERNATION_REBOOT:
> -		case HIBERNATION_TEST:
> -		case HIBERNATION_TESTPROC:
>  			hibernation_mode = mode;
>  			break;
>  		case HIBERNATION_PLATFORM:

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-02 19:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-01 14:20 [PATCH] PM / Hibernation: Remove deprecated hibernation test modes Srivatsa S. Bhat
2011-12-01 21:53 ` Rafael J. Wysocki
2011-12-02 19:31 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®