[PATCH 1/1] PM: Add arch_suspend_disable_nonboot_cpus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

 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
_
_______________________________________________
linux-pm mailing list
linux-pm@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/linux-pm

[Index of Archives]     [Linux ACPI]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [CPU Freq]     [Kernel Newbies]     [Fedora Kernel]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux