public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] PM: Add arch_suspend_disable_nonboot_cpus
@ 2010-02-21 16:32 Brian King
       [not found] ` <20100221191821.GA2198@ucw.cz>
  0 siblings, 1 reply; 10+ messages in thread
From: Brian King @ 2010-02-21 16:32 UTC (permalink / raw)
  To: len.brown; +Cc: brking, linux-pm


Rather than calling disable_nonboot_cpus and enable_nonboot_cpus
directly, wrapper the calls in a weak arch_suspend_disable_nonboot_cpus
and arch_suspend_enable_nonboot_cpus that can be overridden by
architectures that require different handling of suspending processors
at suspend time than these functions provide. This is needed to enable
suspend/resume on IBM Power servers.

Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---

 include/linux/suspend.h |   18 ++++++++++++++++++
 kernel/power/suspend.c  |   14 ++++++++++++--
 2 files changed, 30 insertions(+), 2 deletions(-)

diff -puN kernel/power/suspend.c~suspend_arch_smp kernel/power/suspend.c
--- linux-2.6/kernel/power/suspend.c~suspend_arch_smp	2010-02-17 09:46:59.000000000 -0600
+++ linux-2.6-bjking1/kernel/power/suspend.c	2010-02-17 09:46:59.000000000 -0600
@@ -116,6 +116,16 @@ void __attribute__ ((weak)) arch_suspend
 	local_irq_enable();
 }
 
+int __attribute__ ((weak)) arch_suspend_disable_nonboot_cpus(void)
+{
+	return disable_nonboot_cpus();
+}
+
+void __attribute__ ((weak)) arch_suspend_enable_nonboot_cpus(void)
+{
+	return enable_nonboot_cpus();
+}
+
 /**
  *	suspend_enter - enter the desired system sleep state.
  *	@state:		state to enter
@@ -147,7 +157,7 @@ static int suspend_enter(suspend_state_t
 	if (suspend_test(TEST_PLATFORM))
 		goto Platform_wake;
 
-	error = disable_nonboot_cpus();
+	error = arch_suspend_disable_nonboot_cpus();
 	if (error || suspend_test(TEST_CPUS))
 		goto Enable_cpus;
 
@@ -165,7 +175,7 @@ static int suspend_enter(suspend_state_t
 	BUG_ON(irqs_disabled());
 
  Enable_cpus:
-	enable_nonboot_cpus();
+	arch_suspend_enable_nonboot_cpus();
 
  Platform_wake:
 	if (suspend_ops->wake)
diff -puN include/linux/suspend.h~suspend_arch_smp include/linux/suspend.h
--- linux-2.6/include/linux/suspend.h~suspend_arch_smp	2010-02-17 09:46:59.000000000 -0600
+++ linux-2.6-bjking1/include/linux/suspend.h	2010-02-17 09:46:59.000000000 -0600
@@ -141,6 +141,24 @@ extern void arch_suspend_disable_irqs(vo
  */
 extern void arch_suspend_enable_irqs(void);
 
+/**
+ * arch_suspend_disable_nonboot_cpus - disable non boot for suspend
+ *
+ * Disables non boot CPUs (in the default case). This is a weak symbol in the common
+ * code and thus allows architectures to override it if more needs to be
+ * done. Not called for suspend to disk.
+ */
+extern int arch_suspend_disable_nonboot_cpus(void);
+
+/**
+ * arch_suspend_enable_nonboot_cpus - enable non boot after suspend
+ *
+ * Enables non boot CPUs (in the default case). This is a weak symbol in the common
+ * code and thus allows architectures to override it if more needs to be
+ * done. Not called for suspend to disk.
+ */
+extern void arch_suspend_enable_nonboot_cpus(void);
+
 extern int pm_suspend(suspend_state_t state);
 #else /* !CONFIG_SUSPEND */
 #define suspend_valid_only_mem	NULL
_

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

end of thread, other threads:[~2010-02-23 16:49 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-21 16:32 [PATCH 1/1] PM: Add arch_suspend_disable_nonboot_cpus Brian King
     [not found] ` <20100221191821.GA2198@ucw.cz>
2010-02-21 22:01   ` Brian King
     [not found]     ` <201002212308.52023.rjw@sisk.pl>
2010-02-21 22:22       ` Brian King
     [not found]         ` <201002212327.13399.rjw@sisk.pl>
2010-02-21 22:28           ` Brian King
     [not found]             ` <201002212337.10462.rjw@sisk.pl>
2010-02-21 22:46               ` Brian King
2010-02-22 19:14                 ` Rafael J. Wysocki
2010-02-22 23:31                   ` Brian King
2010-02-23 15:43                     ` Pavel Machek
2010-02-23 16:41                       ` Brian King
2010-02-23 16:49                         ` Pavel Machek

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