Skip to contentSkip to conversation

PM: Fix dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION (updated 2x)

PATCH In review Rafael J. Wysocki 3 participants 8 messages Aug 6, 2007 – Aug 9, 2007

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM: Fix dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION (updated 2x)

[The update is necessary because of the too restrictive conditions for suspend on powerpc.]
---
From: Rafael J. Wysocki <[email protected]>

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

Moreover, SMP suspend and hibernation are only possible if CONFIG_HOTPLUG is set, because they select HOTPLUG_CPU that depends on it.  Also, since suspend and hibernation don't depend on EXPERIMENTAL, arrange things so that CPU hotplug can be selected if it is not set.

---
 arch/arm/Kconfig      |    2 +-
 arch/i386/Kconfig     |    3 ++-
 arch/powerpc/Kconfig  |    3 ++-
 arch/x86_64/Kconfig   |    2 +-
 arch/x86_64/defconfig |    1 -
 include/linux/cpu.h   |    6 +++---
 kernel/cpu.c          |    4 ++--
 kernel/power/Kconfig  |   43 +++++++++++++++++++++++++++++++++----------
 8 files changed, 44 insertions(+), 20 deletions(-)
kernel/power/Kconfig +33 -10
Index: linux-2.6.23-rc2/kernel/power/Kconfig
===================================================================
@@ -72,15 +72,10 @@ config PM_TRACE
 	CAUTION: this option will cause your machine's real-time clock to be
 	set to an invalid time after a resume.
 
-config SUSPEND_SMP_POSSIBLE
-	bool
-	depends on (X86 && !X86_VOYAGER) || (PPC64 && (PPC_PSERIES || PPC_PMAC))
-	depends on SMP
-	default y
-
-config SUSPEND_SMP
+config PM_SLEEP_SMP
 	bool
-	depends on SUSPEND_SMP_POSSIBLE && PM_SLEEP
+	depends on SUSPEND_SMP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
+	depends on PM_SLEEP
 	select HOTPLUG_CPU
 	default y
 
@@ -89,20 +84,48 @@ config PM_SLEEP
 	depends on SUSPEND || HIBERNATION
 	default y
 
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) || PPC || ARM || BLACKFIN || MIPS \
+		   || SUPERH || FRV
+	depends on !SMP
+	default y
+
+config SUSPEND_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) \
+		   || (PPC && (PPC_PSERIES || PPC_PMAC)) || ARM
+	depends on SMP
+	depends on HOTPLUG
+	default y
+
 config SUSPEND
 	bool "Suspend to RAM and standby"
 	depends on PM
-	depends on !SMP || SUSPEND_SMP_POSSIBLE
+	depends on SUSPEND_UP_POSSIBLE || SUSPEND_SMP_POSSIBLE
 	default y
 	---help---
 	  Allow the system to enter sleep states in which main memory is
 	  powered and thus its contents are preserved, such as the
 	  suspend-to-RAM state (i.e. the ACPI S3 state).
 
+config HIBERNATION_UP_POSSIBLE
+	bool
+	depends on X86 || PPC64_SWSUSP || FRV || PPC32
+	depends on !SMP
+	default y
+
+config HIBERNATION_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) || PPC64_SWSUSP
+	depends on SMP
+	depends on HOTPLUG
+	default y
+
 config HIBERNATION
 	bool "Hibernation (aka 'suspend to disk')"
 	depends on PM && SWAP
-	depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) && !SMP) || SUSPEND_SMP_POSSIBLE
+	depends on HIBERNATION_UP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
 	---help---
 	  Enable the suspend to disk (STD) functionality, which is usually
 	  called "hibernation" in user interfaces.  STD checkpoints the
kernel/cpu.c +2 -2
Index: linux-2.6.23-rc2/kernel/cpu.c
===================================================================
@@ -273,7 +273,7 @@ int __cpuinit cpu_up(unsigned int cpu)
 	return err;
 }
 
-#ifdef CONFIG_SUSPEND_SMP
+#ifdef CONFIG_PM_SLEEP_SMP
 static cpumask_t frozen_cpus;
 
 int disable_nonboot_cpus(void)
@@ -334,4 +334,4 @@ void enable_nonboot_cpus(void)
 out:
 	mutex_unlock(&cpu_add_remove_lock);
 }
-#endif
+#endif /* CONFIG_PM_SLEEP_SMP */
include/linux/cpu.h +3 -3
Index: linux-2.6.23-rc2/include/linux/cpu.h
===================================================================
@@ -128,16 +128,16 @@ static inline void cpuhotplug_mutex_unlo
 static inline int cpu_is_offline(int cpu) { return 0; }
 #endif		/* CONFIG_HOTPLUG_CPU */
 
-#ifdef CONFIG_SUSPEND_SMP
+#ifdef CONFIG_PM_SLEEP_SMP
 extern int suspend_cpu_hotplug;
 
 extern int disable_nonboot_cpus(void);
 extern void enable_nonboot_cpus(void);
-#else
+#else /* !CONFIG_PM_SLEEP_SMP */
 #define suspend_cpu_hotplug	0
 
 static inline int disable_nonboot_cpus(void) { return 0; }
 static inline void enable_nonboot_cpus(void) {}
-#endif
+#endif /* !CONFIG_PM_SLEEP_SMP */
 
 #endif /* _LINUX_CPU_H_ */
arch/x86_64/defconfig +0 -1
Index: linux-2.6.23-rc2/arch/x86_64/defconfig
===================================================================
@@ -201,7 +201,6 @@ CONFIG_PM=y
 # CONFIG_PM_DEBUG is not set
 CONFIG_HIBERNATION=y
 CONFIG_PM_STD_PARTITION=""
-CONFIG_SUSPEND_SMP=y
 
 #
 # ACPI (Advanced Configuration and Power Interface) Support
arch/x86_64/Kconfig +1 -1
Index: linux-2.6.23-rc2/arch/x86_64/Kconfig
===================================================================
@@ -445,7 +445,7 @@ config PHYSICAL_ALIGN
 
 config HOTPLUG_CPU
 	bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP)
 	help
 		Say Y here to experiment with turning CPUs off and on.  CPUs
 		can be controlled through /sys/devices/system/cpu/cpu#.
arch/arm/Kconfig +1 -1
Index: linux-2.6.23-rc2/arch/arm/Kconfig
===================================================================
@@ -594,7 +594,7 @@ config NR_CPUS
 
 config HOTPLUG_CPU
 	bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP)
 	help
 	  Say Y here to experiment with turning CPUs off and on.  CPUs
 	  can be controlled through /sys/devices/system/cpu.
arch/i386/Kconfig +2 -1
Index: linux-2.6.23-rc2/arch/i386/Kconfig
===================================================================
@@ -904,7 +904,8 @@ config PHYSICAL_ALIGN
 
 config HOTPLUG_CPU
 	bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP) \
+		   && !X86_VOYAGER
 	---help---
 	  Say Y here to experiment with turning CPUs off and on, and to
 	  enable suspend on SMP systems. CPUs can be controlled through
arch/powerpc/Kconfig +2 -1
Index: linux-2.6.23-rc2/arch/powerpc/Kconfig
===================================================================
@@ -194,7 +194,8 @@ config IOMMU_VMERGE
 
 config HOTPLUG_CPU
 	bool "Support for enabling/disabling CPUs"
-	depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC)
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP) \
+		   && (PPC_PSERIES || PPC_PMAC)
 	---help---
 	  Say Y here to be able to disable and re-enable individual
 	  CPUs at runtime on SMP machines.
#1 lore raw
Quoted 12 lines

[The update is necessary because of the too restrictive conditions for suspend on powerpc.]
---
From: Rafael J. Wysocki <[email protected]>

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

Quoted 6 lines

Moreover, SMP suspend and hibernation are only possible if CONFIG_HOTPLUG is set, because they select HOTPLUG_CPU that depends on it.  Also, since suspend and hibernation don't depend on EXPERIMENTAL, arrange things so that CPU hotplug can be selected if it is not set.

ACK.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
In reply to Rafael J. Wysocki
Quoted 10 lines · On Tue, 7 Aug 2007 00:23:26 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

Moreover, SMP suspend and hibernation are only possible if CONFIG_HOTPLUG is set, because they select HOTPLUG_CPU that depends on it. __Also, since suspend and hibernation don't depend on EXPERIMENTAL, arrange things so that CPU hotplug can be selected if it is not set.

The version of this which I have (version eighty eight, afaict :), reproduced below) breaks ia64 allmodconfig:

init/Kconfig:416:error: found recursive dependency: HOTPLUG -> SUSPEND_SMP_POSSIBLE -> PM_SLEEP_SMP -> HOTPLUG_CPU -> HOTPLUG
-> PCCARD -> PCMCIA -> USB_ARCH_HAS_HCD -> MOUSE_APPLETOUCH -> USB -> USB_SISUS

From: Rafael J. Wysocki <[email protected]>

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

Moreover, SMP suspend and hibernation are only possible if CONFIG_HOTPLUG is set, because they select HOTPLUG_CPU that depends on it. _Also, since suspend and hibernation don't depend on EXPERIMENTAL, arrange things so that CPU hotplug can be selected if it is not set.

Cc Andi Kleen <[email protected]>
Cc Russell King <[email protected]>
Cc Len Brown <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>

---

 arch/arm/Kconfig      |    2 -
 arch/i386/Kconfig     |    3 +-
 arch/powerpc/Kconfig  |    3 +-
 arch/x86_64/Kconfig   |    2 -
 arch/x86_64/defconfig |    1 
 include/linux/cpu.h   |    6 ++---
 kernel/cpu.c          |    4 +--
 kernel/power/Kconfig  |   43 ++++++++++++++++++++++++++++++----------
 8 files changed, 44 insertions(+), 20 deletions(-)
arch/arm/Kconfig renamed from arch/arm/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +1 -1
diff -puN arch/arm/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x arch/arm/Kconfig
@@ -594,7 +594,7 @@ config NR_CPUS
 
 config HOTPLUG_CPU
 	bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP)
 	help
 	  Say Y here to experiment with turning CPUs off and on.  CPUs
 	  can be controlled through /sys/devices/system/cpu.
arch/i386/Kconfig renamed from arch/i386/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +2 -1
diff -puN arch/i386/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x arch/i386/Kconfig
@@ -904,7 +904,8 @@ config PHYSICAL_ALIGN
 
 config HOTPLUG_CPU
 	bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP) \
+		   && !X86_VOYAGER
 	---help---
 	  Say Y here to experiment with turning CPUs off and on, and to
 	  enable suspend on SMP systems. CPUs can be controlled through
arch/powerpc/Kconfig renamed from arch/powerpc/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +2 -1
diff -puN arch/powerpc/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x arch/powerpc/Kconfig
@@ -194,7 +194,8 @@ config IOMMU_VMERGE
 
 config HOTPLUG_CPU
 	bool "Support for enabling/disabling CPUs"
-	depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC)
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP) \
+		   && (PPC_PSERIES || PPC_PMAC)
 	---help---
 	  Say Y here to be able to disable and re-enable individual
 	  CPUs at runtime on SMP machines.
arch/x86_64/Kconfig renamed from arch/x86_64/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +1 -1
diff -puN arch/x86_64/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x arch/x86_64/Kconfig
@@ -445,7 +445,7 @@ config PHYSICAL_ALIGN
 
 config HOTPLUG_CPU
 	bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP)
 	help
 		Say Y here to experiment with turning CPUs off and on.  CPUs
 		can be controlled through /sys/devices/system/cpu/cpu#.
arch/x86_64/defconfig renamed from arch/x86_64/defconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +0 -1
diff -puN arch/x86_64/defconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x arch/x86_64/defconfig
@@ -201,7 +201,6 @@ CONFIG_PM=y
 # CONFIG_PM_DEBUG is not set
 CONFIG_HIBERNATION=y
 CONFIG_PM_STD_PARTITION=""
-CONFIG_SUSPEND_SMP=y
 
 #
 # ACPI (Advanced Configuration and Power Interface) Support
include/linux/cpu.h renamed from include/linux/cpu.h~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +3 -3
diff -puN include/linux/cpu.h~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x include/linux/cpu.h
@@ -128,16 +128,16 @@ static inline void cpuhotplug_mutex_unlo
 static inline int cpu_is_offline(int cpu) { return 0; }
 #endif		/* CONFIG_HOTPLUG_CPU */
 
-#ifdef CONFIG_SUSPEND_SMP
+#ifdef CONFIG_PM_SLEEP_SMP
 extern int suspend_cpu_hotplug;
 
 extern int disable_nonboot_cpus(void);
 extern void enable_nonboot_cpus(void);
-#else
+#else /* !CONFIG_PM_SLEEP_SMP */
 #define suspend_cpu_hotplug	0
 
 static inline int disable_nonboot_cpus(void) { return 0; }
 static inline void enable_nonboot_cpus(void) {}
-#endif
+#endif /* !CONFIG_PM_SLEEP_SMP */
 
 #endif /* _LINUX_CPU_H_ */
kernel/cpu.c renamed from kernel/cpu.c~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +2 -2
diff -puN kernel/cpu.c~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x kernel/cpu.c
@@ -273,7 +273,7 @@ int __cpuinit cpu_up(unsigned int cpu)
 	return err;
 }
 
-#ifdef CONFIG_SUSPEND_SMP
+#ifdef CONFIG_PM_SLEEP_SMP
 static cpumask_t frozen_cpus;
 
 int disable_nonboot_cpus(void)
@@ -334,4 +334,4 @@ void enable_nonboot_cpus(void)
 out:
 	mutex_unlock(&cpu_add_remove_lock);
 }
-#endif
+#endif /* CONFIG_PM_SLEEP_SMP */
kernel/power/Kconfig renamed from kernel/power/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +33 -10

68 lines not on this page · raw message

_

#3 lore raw
In reply to Rafael J. Wysocki
Quoted 10 lines · On Tue, 7 Aug 2007 00:23:26 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

Moreover, SMP suspend and hibernation are only possible if CONFIG_HOTPLUG is set, because they select HOTPLUG_CPU that depends on it. __Also, since suspend and hibernation don't depend on EXPERIMENTAL, arrange things so that CPU hotplug can be selected if it is not set.

The version of this which I have (version eighty eight, afaict :), reproduced below) breaks ia64 allmodconfig:

init/Kconfig:416:error: found recursive dependency: HOTPLUG -> SUSPEND_SMP_POSSIBLE -> PM_SLEEP_SMP -> HOTPLUG_CPU -> HOTPLUG
-> PCCARD -> PCMCIA -> USB_ARCH_HAS_HCD -> MOUSE_APPLETOUCH -> USB -> USB_SISUS

From: Rafael J. Wysocki <[email protected]>

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

Moreover, SMP suspend and hibernation are only possible if CONFIG_HOTPLUG is set, because they select HOTPLUG_CPU that depends on it. _Also, since suspend and hibernation don't depend on EXPERIMENTAL, arrange things so that CPU hotplug can be selected if it is not set.

Cc Andi Kleen <[email protected]>
Cc Russell King <[email protected]>
Cc Len Brown <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>

---

 arch/arm/Kconfig      |    2 -
 arch/i386/Kconfig     |    3 +-
 arch/powerpc/Kconfig  |    3 +-
 arch/x86_64/Kconfig   |    2 -
 arch/x86_64/defconfig |    1 
 include/linux/cpu.h   |    6 ++---
 kernel/cpu.c          |    4 +--
 kernel/power/Kconfig  |   43 ++++++++++++++++++++++++++++++----------
 8 files changed, 44 insertions(+), 20 deletions(-)
arch/arm/Kconfig renamed from arch/arm/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +1 -1
diff -puN arch/arm/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x arch/arm/Kconfig
@@ -594,7 +594,7 @@ config NR_CPUS
 
 config HOTPLUG_CPU
 	bool "Support for hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP)
 	help
 	  Say Y here to experiment with turning CPUs off and on.  CPUs
 	  can be controlled through /sys/devices/system/cpu.
arch/i386/Kconfig renamed from arch/i386/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +2 -1
diff -puN arch/i386/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x arch/i386/Kconfig
@@ -904,7 +904,8 @@ config PHYSICAL_ALIGN
 
 config HOTPLUG_CPU
 	bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP) \
+		   && !X86_VOYAGER
 	---help---
 	  Say Y here to experiment with turning CPUs off and on, and to
 	  enable suspend on SMP systems. CPUs can be controlled through
arch/powerpc/Kconfig renamed from arch/powerpc/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +2 -1
diff -puN arch/powerpc/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x arch/powerpc/Kconfig
@@ -194,7 +194,8 @@ config IOMMU_VMERGE
 
 config HOTPLUG_CPU
 	bool "Support for enabling/disabling CPUs"
-	depends on SMP && HOTPLUG && EXPERIMENTAL && (PPC_PSERIES || PPC_PMAC)
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP) \
+		   && (PPC_PSERIES || PPC_PMAC)
 	---help---
 	  Say Y here to be able to disable and re-enable individual
 	  CPUs at runtime on SMP machines.
arch/x86_64/Kconfig renamed from arch/x86_64/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +1 -1
diff -puN arch/x86_64/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x arch/x86_64/Kconfig
@@ -445,7 +445,7 @@ config PHYSICAL_ALIGN
 
 config HOTPLUG_CPU
 	bool "Support for suspend on SMP and hot-pluggable CPUs (EXPERIMENTAL)"
-	depends on SMP && HOTPLUG && EXPERIMENTAL
+	depends on SMP && HOTPLUG && (EXPERIMENTAL || PM_SLEEP_SMP)
 	help
 		Say Y here to experiment with turning CPUs off and on.  CPUs
 		can be controlled through /sys/devices/system/cpu/cpu#.
arch/x86_64/defconfig renamed from arch/x86_64/defconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +0 -1
diff -puN arch/x86_64/defconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x arch/x86_64/defconfig
@@ -201,7 +201,6 @@ CONFIG_PM=y
 # CONFIG_PM_DEBUG is not set
 CONFIG_HIBERNATION=y
 CONFIG_PM_STD_PARTITION=""
-CONFIG_SUSPEND_SMP=y
 
 #
 # ACPI (Advanced Configuration and Power Interface) Support
include/linux/cpu.h renamed from include/linux/cpu.h~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +3 -3
diff -puN include/linux/cpu.h~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x include/linux/cpu.h
@@ -128,16 +128,16 @@ static inline void cpuhotplug_mutex_unlo
 static inline int cpu_is_offline(int cpu) { return 0; }
 #endif		/* CONFIG_HOTPLUG_CPU */
 
-#ifdef CONFIG_SUSPEND_SMP
+#ifdef CONFIG_PM_SLEEP_SMP
 extern int suspend_cpu_hotplug;
 
 extern int disable_nonboot_cpus(void);
 extern void enable_nonboot_cpus(void);
-#else
+#else /* !CONFIG_PM_SLEEP_SMP */
 #define suspend_cpu_hotplug	0
 
 static inline int disable_nonboot_cpus(void) { return 0; }
 static inline void enable_nonboot_cpus(void) {}
-#endif
+#endif /* !CONFIG_PM_SLEEP_SMP */
 
 #endif /* _LINUX_CPU_H_ */
kernel/cpu.c renamed from kernel/cpu.c~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +2 -2
diff -puN kernel/cpu.c~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x kernel/cpu.c
@@ -273,7 +273,7 @@ int __cpuinit cpu_up(unsigned int cpu)
 	return err;
 }
 
-#ifdef CONFIG_SUSPEND_SMP
+#ifdef CONFIG_PM_SLEEP_SMP
 static cpumask_t frozen_cpus;
 
 int disable_nonboot_cpus(void)
@@ -334,4 +334,4 @@ void enable_nonboot_cpus(void)
 out:
 	mutex_unlock(&cpu_add_remove_lock);
 }
-#endif
+#endif /* CONFIG_PM_SLEEP_SMP */
kernel/power/Kconfig renamed from kernel/power/Kconfig~pm-fix-dependencies-of-config_suspend-and-config_hibernation-updated-2x +33 -10

68 lines not on this page · raw message

_

#4 lore raw
Quoted 14 lines · Andrew Morton
Quoted 10 lines · On Tue, 7 Aug 2007 00:23:26 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

Moreover, SMP suspend and hibernation are only possible if CONFIG_HOTPLUG is set, because they select HOTPLUG_CPU that depends on it. __Also, since suspend and hibernation don't depend on EXPERIMENTAL, arrange things so that CPU hotplug can be selected if it is not set.

Quoted 5 lines

The version of this which I have (version eighty eight, afaict :), reproduced below) breaks ia64 allmodconfig:

init/Kconfig:416:error: found recursive dependency: HOTPLUG -> SUSPEND_SMP_POSSIBLE -> PM_SLEEP_SMP -> HOTPLUG_CPU -> HOTPLUG
-> PCCARD -> PCMCIA -> USB_ARCH_HAS_HCD -> MOUSE_APPLETOUCH -> USB -> USB_SISUS

Well, I have no idea how this is even possible.

On ia64 HOTPLUG_CPU depends only on SMP && EXPERIMENTAL and the patch doesn't change that. Moreover, SUSPEND_SMP_POSSIBLE cannot be set on ia64, either with the patch or without it.

Anyway, I'm going to drop the "HOTPLUG depends on PM_SLEEP_SMP" bits and retest with allmodconfig on everyting I can test.

BTW, the patch is needed to fix compilation problems on PPC.

Greetings,
Rafael

Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth
#5 lore raw
In reply to Andrew Morton
Quoted 14 lines · Andrew Morton
Quoted 10 lines · On Tue, 7 Aug 2007 00:23:26 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

Moreover, SMP suspend and hibernation are only possible if CONFIG_HOTPLUG is set, because they select HOTPLUG_CPU that depends on it. __Also, since suspend and hibernation don't depend on EXPERIMENTAL, arrange things so that CPU hotplug can be selected if it is not set.

Quoted 5 lines

The version of this which I have (version eighty eight, afaict :), reproduced below) breaks ia64 allmodconfig:

init/Kconfig:416:error: found recursive dependency: HOTPLUG -> SUSPEND_SMP_POSSIBLE -> PM_SLEEP_SMP -> HOTPLUG_CPU -> HOTPLUG
-> PCCARD -> PCMCIA -> USB_ARCH_HAS_HCD -> MOUSE_APPLETOUCH -> USB -> USB_SISUS

Well, I have no idea how this is even possible.

On ia64 HOTPLUG_CPU depends only on SMP && EXPERIMENTAL and the patch doesn't change that. Moreover, SUSPEND_SMP_POSSIBLE cannot be set on ia64, either with the patch or without it.

Anyway, I'm going to drop the "HOTPLUG depends on PM_SLEEP_SMP" bits and retest with allmodconfig on everyting I can test.

BTW, the patch is needed to fix compilation problems on PPC.

Greetings,
Rafael

Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth
#6 lore raw

PATCH 1/1 PM: Fix dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION (updated 3x)

In reply to Andrew Morton
Quoted 14 lines · Andrew Morton
Quoted 10 lines · On Tue, 7 Aug 2007 00:23:26 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

Moreover, SMP suspend and hibernation are only possible if CONFIG_HOTPLUG is set, because they select HOTPLUG_CPU that depends on it. __Also, since suspend and hibernation don't depend on EXPERIMENTAL, arrange things so that CPU hotplug can be selected if it is not set.

Quoted 5 lines

The version of this which I have (version eighty eight, afaict :), reproduced below) breaks ia64 allmodconfig:

init/Kconfig:416:error: found recursive dependency: HOTPLUG -> SUSPEND_SMP_POSSIBLE -> PM_SLEEP_SMP -> HOTPLUG_CPU -> HOTPLUG
-> PCCARD -> PCMCIA -> USB_ARCH_HAS_HCD -> MOUSE_APPLETOUCH -> USB -> USB_SISUS

OK

Here's the minimal version of the patch, without the tricky dependencies on HOTPLUG and PM_SLEEP_SMP.

I have tested allmodconfig (cross) compilation of it for ia64 and powerpc (ppc32). It also has been tested on x86_64 and i386 as well as (cross) compiled for some ARM platforms. Hope that's enough (fingers crossed).

---
From: Rafael J. Wysocki <[email protected]>

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

---
 arch/x86_64/defconfig |    1 -
 include/linux/cpu.h   |    6 +++---
 kernel/cpu.c          |    4 ++--
 kernel/power/Kconfig  |   41 +++++++++++++++++++++++++++++++----------
 4 files changed, 36 insertions(+), 16 deletions(-)
kernel/power/Kconfig +31 -10
Index: linux-2.6.23-rc2/kernel/power/Kconfig
===================================================================
@@ -72,15 +72,10 @@ config PM_TRACE
 	CAUTION: this option will cause your machine's real-time clock to be
 	set to an invalid time after a resume.
 
-config SUSPEND_SMP_POSSIBLE
-	bool
-	depends on (X86 && !X86_VOYAGER) || (PPC64 && (PPC_PSERIES || PPC_PMAC))
-	depends on SMP
-	default y
-
-config SUSPEND_SMP
+config PM_SLEEP_SMP
 	bool
-	depends on SUSPEND_SMP_POSSIBLE && PM_SLEEP
+	depends on SUSPEND_SMP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
+	depends on PM_SLEEP
 	select HOTPLUG_CPU
 	default y
 
@@ -89,20 +84,46 @@ config PM_SLEEP
 	depends on SUSPEND || HIBERNATION
 	default y
 
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) || PPC || ARM || BLACKFIN || MIPS \
+		   || SUPERH || FRV
+	depends on !SMP
+	default y
+
+config SUSPEND_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) \
+		   || (PPC && (PPC_PSERIES || PPC_PMAC)) || ARM
+	depends on SMP
+	default y
+
 config SUSPEND
 	bool "Suspend to RAM and standby"
 	depends on PM
-	depends on !SMP || SUSPEND_SMP_POSSIBLE
+	depends on SUSPEND_UP_POSSIBLE || SUSPEND_SMP_POSSIBLE
 	default y
 	---help---
 	  Allow the system to enter sleep states in which main memory is
 	  powered and thus its contents are preserved, such as the
 	  suspend-to-RAM state (i.e. the ACPI S3 state).
 
+config HIBERNATION_UP_POSSIBLE
+	bool
+	depends on X86 || PPC64_SWSUSP || FRV || PPC32
+	depends on !SMP
+	default y
+
+config HIBERNATION_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) || PPC64_SWSUSP
+	depends on SMP
+	default y
+
 config HIBERNATION
 	bool "Hibernation (aka 'suspend to disk')"
 	depends on PM && SWAP
-	depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) && !SMP) || SUSPEND_SMP_POSSIBLE
+	depends on HIBERNATION_UP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
 	---help---
 	  Enable the suspend to disk (STD) functionality, which is usually
 	  called "hibernation" in user interfaces.  STD checkpoints the
kernel/cpu.c +2 -2
Index: linux-2.6.23-rc2/kernel/cpu.c
===================================================================
@@ -273,7 +273,7 @@ int __cpuinit cpu_up(unsigned int cpu)
 	return err;
 }
 
-#ifdef CONFIG_SUSPEND_SMP
+#ifdef CONFIG_PM_SLEEP_SMP
 static cpumask_t frozen_cpus;
 
 int disable_nonboot_cpus(void)
@@ -334,4 +334,4 @@ void enable_nonboot_cpus(void)
 out:
 	mutex_unlock(&cpu_add_remove_lock);
 }
-#endif
+#endif /* CONFIG_PM_SLEEP_SMP */
include/linux/cpu.h +3 -3
Index: linux-2.6.23-rc2/include/linux/cpu.h
===================================================================
@@ -128,16 +128,16 @@ static inline void cpuhotplug_mutex_unlo
 static inline int cpu_is_offline(int cpu) { return 0; }
 #endif		/* CONFIG_HOTPLUG_CPU */
 
-#ifdef CONFIG_SUSPEND_SMP
+#ifdef CONFIG_PM_SLEEP_SMP
 extern int suspend_cpu_hotplug;
 
 extern int disable_nonboot_cpus(void);
 extern void enable_nonboot_cpus(void);
-#else
+#else /* !CONFIG_PM_SLEEP_SMP */
 #define suspend_cpu_hotplug	0
 
 static inline int disable_nonboot_cpus(void) { return 0; }
 static inline void enable_nonboot_cpus(void) {}
-#endif
+#endif /* !CONFIG_PM_SLEEP_SMP */
 
 #endif /* _LINUX_CPU_H_ */
arch/x86_64/defconfig +0 -1
Index: linux-2.6.23-rc2/arch/x86_64/defconfig
===================================================================
@@ -201,7 +201,6 @@ CONFIG_PM=y
 # CONFIG_PM_DEBUG is not set
 CONFIG_HIBERNATION=y
 CONFIG_PM_STD_PARTITION=""
-CONFIG_SUSPEND_SMP=y
 
 #
 # ACPI (Advanced Configuration and Power Interface) Support
#7 lore raw

PATCH 1/1 PM: Fix dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION (updated 3x)

In reply to Andrew Morton
Quoted 14 lines · Andrew Morton
Quoted 10 lines · On Tue, 7 Aug 2007 00:23:26 +0200 "Rafael J. Wysocki" <[email protected]> wrote:

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

Moreover, SMP suspend and hibernation are only possible if CONFIG_HOTPLUG is set, because they select HOTPLUG_CPU that depends on it. __Also, since suspend and hibernation don't depend on EXPERIMENTAL, arrange things so that CPU hotplug can be selected if it is not set.

Quoted 5 lines

The version of this which I have (version eighty eight, afaict :), reproduced below) breaks ia64 allmodconfig:

init/Kconfig:416:error: found recursive dependency: HOTPLUG -> SUSPEND_SMP_POSSIBLE -> PM_SLEEP_SMP -> HOTPLUG_CPU -> HOTPLUG
-> PCCARD -> PCMCIA -> USB_ARCH_HAS_HCD -> MOUSE_APPLETOUCH -> USB -> USB_SISUS

OK

Here's the minimal version of the patch, without the tricky dependencies on HOTPLUG and PM_SLEEP_SMP.

I have tested allmodconfig (cross) compilation of it for ia64 and powerpc (ppc32). It also has been tested on x86_64 and i386 as well as (cross) compiled for some ARM platforms. Hope that's enough (fingers crossed).

---
From: Rafael J. Wysocki <[email protected]>

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit 296699de6bdc717189a331ab6bbe90e05c94db06 "Introduce CONFIG_SUSPEND for suspend-to-Ram and standby" are incorrect, as they don't cover the facts that
(1) not all architectures support suspend and (2) SMP hibernation is only possible on X86 and PPC64 (if CONFIG_PPC64_SWSUSP is set).

---
 arch/x86_64/defconfig |    1 -
 include/linux/cpu.h   |    6 +++---
 kernel/cpu.c          |    4 ++--
 kernel/power/Kconfig  |   41 +++++++++++++++++++++++++++++++----------
 4 files changed, 36 insertions(+), 16 deletions(-)
kernel/power/Kconfig +31 -10
Index: linux-2.6.23-rc2/kernel/power/Kconfig
===================================================================
@@ -72,15 +72,10 @@ config PM_TRACE
 	CAUTION: this option will cause your machine's real-time clock to be
 	set to an invalid time after a resume.
 
-config SUSPEND_SMP_POSSIBLE
-	bool
-	depends on (X86 && !X86_VOYAGER) || (PPC64 && (PPC_PSERIES || PPC_PMAC))
-	depends on SMP
-	default y
-
-config SUSPEND_SMP
+config PM_SLEEP_SMP
 	bool
-	depends on SUSPEND_SMP_POSSIBLE && PM_SLEEP
+	depends on SUSPEND_SMP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
+	depends on PM_SLEEP
 	select HOTPLUG_CPU
 	default y
 
@@ -89,20 +84,46 @@ config PM_SLEEP
 	depends on SUSPEND || HIBERNATION
 	default y
 
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) || PPC || ARM || BLACKFIN || MIPS \
+		   || SUPERH || FRV
+	depends on !SMP
+	default y
+
+config SUSPEND_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) \
+		   || (PPC && (PPC_PSERIES || PPC_PMAC)) || ARM
+	depends on SMP
+	default y
+
 config SUSPEND
 	bool "Suspend to RAM and standby"
 	depends on PM
-	depends on !SMP || SUSPEND_SMP_POSSIBLE
+	depends on SUSPEND_UP_POSSIBLE || SUSPEND_SMP_POSSIBLE
 	default y
 	---help---
 	  Allow the system to enter sleep states in which main memory is
 	  powered and thus its contents are preserved, such as the
 	  suspend-to-RAM state (i.e. the ACPI S3 state).
 
+config HIBERNATION_UP_POSSIBLE
+	bool
+	depends on X86 || PPC64_SWSUSP || FRV || PPC32
+	depends on !SMP
+	default y
+
+config HIBERNATION_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) || PPC64_SWSUSP
+	depends on SMP
+	default y
+
 config HIBERNATION
 	bool "Hibernation (aka 'suspend to disk')"
 	depends on PM && SWAP
-	depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) && !SMP) || SUSPEND_SMP_POSSIBLE
+	depends on HIBERNATION_UP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
 	---help---
 	  Enable the suspend to disk (STD) functionality, which is usually
 	  called "hibernation" in user interfaces.  STD checkpoints the
kernel/cpu.c +2 -2
Index: linux-2.6.23-rc2/kernel/cpu.c
===================================================================
@@ -273,7 +273,7 @@ int __cpuinit cpu_up(unsigned int cpu)
 	return err;
 }
 
-#ifdef CONFIG_SUSPEND_SMP
+#ifdef CONFIG_PM_SLEEP_SMP
 static cpumask_t frozen_cpus;
 
 int disable_nonboot_cpus(void)
@@ -334,4 +334,4 @@ void enable_nonboot_cpus(void)
 out:
 	mutex_unlock(&cpu_add_remove_lock);
 }
-#endif
+#endif /* CONFIG_PM_SLEEP_SMP */
include/linux/cpu.h +3 -3
Index: linux-2.6.23-rc2/include/linux/cpu.h
===================================================================
@@ -128,16 +128,16 @@ static inline void cpuhotplug_mutex_unlo
 static inline int cpu_is_offline(int cpu) { return 0; }
 #endif		/* CONFIG_HOTPLUG_CPU */
 
-#ifdef CONFIG_SUSPEND_SMP
+#ifdef CONFIG_PM_SLEEP_SMP
 extern int suspend_cpu_hotplug;
 
 extern int disable_nonboot_cpus(void);
 extern void enable_nonboot_cpus(void);
-#else
+#else /* !CONFIG_PM_SLEEP_SMP */
 #define suspend_cpu_hotplug	0
 
 static inline int disable_nonboot_cpus(void) { return 0; }
 static inline void enable_nonboot_cpus(void) {}
-#endif
+#endif /* !CONFIG_PM_SLEEP_SMP */
 
 #endif /* _LINUX_CPU_H_ */
arch/x86_64/defconfig +0 -1
Index: linux-2.6.23-rc2/arch/x86_64/defconfig
===================================================================
@@ -201,7 +201,6 @@ CONFIG_PM=y
 # CONFIG_PM_DEBUG is not set
 CONFIG_HIBERNATION=y
 CONFIG_PM_STD_PARTITION=""
-CONFIG_SUSPEND_SMP=y
 
 #
 # ACPI (Advanced Configuration and Power Interface) Support