PM: Fix dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION

Dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION introduced by commit
296699de6b "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).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Rafael J. Wysocki 2007-08-30 23:56:29 -07:00 committed by Linus Torvalds
parent b07e35f94a
commit f3de4be9d5
4 changed files with 36 additions and 16 deletions

View File

@ -201,7 +201,6 @@ CONFIG_PM=y
# CONFIG_PM_DEBUG is not set # CONFIG_PM_DEBUG is not set
CONFIG_HIBERNATION=y CONFIG_HIBERNATION=y
CONFIG_PM_STD_PARTITION="" CONFIG_PM_STD_PARTITION=""
CONFIG_SUSPEND_SMP=y
# #
# ACPI (Advanced Configuration and Power Interface) Support # ACPI (Advanced Configuration and Power Interface) Support

View File

@ -126,16 +126,16 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
static inline int cpu_is_offline(int cpu) { return 0; } static inline int cpu_is_offline(int cpu) { return 0; }
#endif /* CONFIG_HOTPLUG_CPU */ #endif /* CONFIG_HOTPLUG_CPU */
#ifdef CONFIG_SUSPEND_SMP #ifdef CONFIG_PM_SLEEP_SMP
extern int suspend_cpu_hotplug; extern int suspend_cpu_hotplug;
extern int disable_nonboot_cpus(void); extern int disable_nonboot_cpus(void);
extern void enable_nonboot_cpus(void); extern void enable_nonboot_cpus(void);
#else #else /* !CONFIG_PM_SLEEP_SMP */
#define suspend_cpu_hotplug 0 #define suspend_cpu_hotplug 0
static inline int disable_nonboot_cpus(void) { return 0; } static inline int disable_nonboot_cpus(void) { return 0; }
static inline void enable_nonboot_cpus(void) {} static inline void enable_nonboot_cpus(void) {}
#endif #endif /* !CONFIG_PM_SLEEP_SMP */
#endif /* _LINUX_CPU_H_ */ #endif /* _LINUX_CPU_H_ */

View File

@ -273,7 +273,7 @@ int __cpuinit cpu_up(unsigned int cpu)
return err; return err;
} }
#ifdef CONFIG_SUSPEND_SMP #ifdef CONFIG_PM_SLEEP_SMP
static cpumask_t frozen_cpus; static cpumask_t frozen_cpus;
int disable_nonboot_cpus(void) int disable_nonboot_cpus(void)
@ -334,4 +334,4 @@ void enable_nonboot_cpus(void)
out: out:
mutex_unlock(&cpu_add_remove_lock); mutex_unlock(&cpu_add_remove_lock);
} }
#endif #endif /* CONFIG_PM_SLEEP_SMP */

View File

@ -72,15 +72,10 @@ config PM_TRACE
CAUTION: this option will cause your machine's real-time clock to be CAUTION: this option will cause your machine's real-time clock to be
set to an invalid time after a resume. set to an invalid time after a resume.
config SUSPEND_SMP_POSSIBLE config PM_SLEEP_SMP
bool bool
depends on (X86 && !X86_VOYAGER) || (PPC64 && (PPC_PSERIES || PPC_PMAC)) depends on SUSPEND_SMP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
depends on SMP depends on PM_SLEEP
default y
config SUSPEND_SMP
bool
depends on SUSPEND_SMP_POSSIBLE && PM_SLEEP
select HOTPLUG_CPU select HOTPLUG_CPU
default y default y
@ -89,20 +84,46 @@ config PM_SLEEP
depends on SUSPEND || HIBERNATION depends on SUSPEND || HIBERNATION
default y 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 config SUSPEND
bool "Suspend to RAM and standby" bool "Suspend to RAM and standby"
depends on PM depends on PM
depends on !SMP || SUSPEND_SMP_POSSIBLE depends on SUSPEND_UP_POSSIBLE || SUSPEND_SMP_POSSIBLE
default y default y
---help--- ---help---
Allow the system to enter sleep states in which main memory is Allow the system to enter sleep states in which main memory is
powered and thus its contents are preserved, such as the powered and thus its contents are preserved, such as the
suspend-to-RAM state (i.e. the ACPI S3 state). 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 config HIBERNATION
bool "Hibernation (aka 'suspend to disk')" bool "Hibernation (aka 'suspend to disk')"
depends on PM && SWAP depends on PM && SWAP
depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) && !SMP) || SUSPEND_SMP_POSSIBLE depends on HIBERNATION_UP_POSSIBLE || HIBERNATION_SMP_POSSIBLE
---help--- ---help---
Enable the suspend to disk (STD) functionality, which is usually Enable the suspend to disk (STD) functionality, which is usually
called "hibernation" in user interfaces. STD checkpoints the called "hibernation" in user interfaces. STD checkpoints the