Skip to contentSkip to conversation

PM: Fix dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION

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

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

PATCH 1/1 PM: Fix dependencies of CONFIG_SUSPEND and CONFIG_HIBERNATION

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 PPC64_SWSUSP is set).

---
 kernel/power/Kconfig |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
kernel/power/Kconfig +6 -3
Index: linux-2.6/kernel/power/Kconfig
===================================================================
@@ -74,7 +74,8 @@ config PM_TRACE
 
 config SUSPEND_SMP_POSSIBLE
 	bool
-	depends on (X86 && !X86_VOYAGER) || (PPC64 && (PPC_PSERIES || PPC_PMAC))
+	depends on (X86 && !X86_VOYAGER) \
+		   || (PPC64 && (PPC_PSERIES || PPC_PMAC)) || ARM
 	depends on SMP
 	default y
 
@@ -92,7 +93,8 @@ config PM_SLEEP
 config SUSPEND
 	bool "Suspend to RAM and standby"
 	depends on PM
-	depends on !SMP || SUSPEND_SMP_POSSIBLE
+	depends on SUSPEND_SMP_POSSIBLE || ((BLACKFIN || MIPS || SUPERH || FRV \
+		    || (PPC32 && PPC_MPC52xx)) && !SMP)
 	default y
 	---help---
 	  Allow the system to enter sleep states in which main memory is
@@ -102,7 +104,8 @@ config SUSPEND
 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 ((X86 || PPC64_SWSUSP || FRV || PPC32) && !SMP) \
+		   || ((X86 || PPC64_SWSUSP) && SUSPEND_SMP_POSSIBLE)
 	---help---
 	  Enable the suspend to disk (STD) functionality, which is usually
 	  called "hibernation" in user interfaces.  STD checkpoints the
#1 lore raw

kernel/power/Kconfig config PM_SLEEP · line 97

Quoted 4 lines · Rafael J. Wysocki
kernel/power/Kconfig +2 -1
 	depends on PM
-	depends on !SMP || SUSPEND_SMP_POSSIBLE
+	depends on SUSPEND_SMP_POSSIBLE || ((BLACKFIN || MIPS || SUPERH || FRV \
+		    || (PPC32 && PPC_MPC52xx)) && !SMP)

Please, do that as SUSPEND_UP_POSSIBLE, and make it look like

	config SUSPEND_UP_POSSIBLE
		depends on BLACKFIN || MIPS || SUPERH || FRV || ((PPC32 && PPC_MPC52xx)
		depends on !SMP
		default y

and now you can write the above thing as

	depends on SUSPEND_SMP_POSSIBLE || SUSPEND_UP_POSSIBLE

and it's all much nicer.

I would say that doing a similar setup for HIBERNATE would be nice too, but the SUSPEND case is more noticeable because the SMP case is so nice already.

Linus

#2 lore raw
In reply to Rafael J. Wysocki

kernel/power/Kconfig config PM_SLEEP · line 97

Quoted 4 lines · Rafael J. Wysocki
kernel/power/Kconfig +2 -1
 	depends on PM
-	depends on !SMP || SUSPEND_SMP_POSSIBLE
+	depends on SUSPEND_SMP_POSSIBLE || ((BLACKFIN || MIPS || SUPERH || FRV \
+		    || (PPC32 && PPC_MPC52xx)) && !SMP)

Please, do that as SUSPEND_UP_POSSIBLE, and make it look like

	config SUSPEND_UP_POSSIBLE
		depends on BLACKFIN || MIPS || SUPERH || FRV || ((PPC32 && PPC_MPC52xx)
		depends on !SMP
		default y

and now you can write the above thing as

	depends on SUSPEND_SMP_POSSIBLE || SUSPEND_UP_POSSIBLE

and it's all much nicer.

I would say that doing a similar setup for HIBERNATE would be nice too, but the SUSPEND case is more noticeable because the SMP case is so nice already.

Linus

#3 lore raw
Quoted 9 lines · Linus Torvalds

Review

Quoted 4 lines · Rafael J. Wysocki
(quoted diff) +2 -1
 	depends on PM
-	depends on !SMP || SUSPEND_SMP_POSSIBLE
+	depends on SUSPEND_SMP_POSSIBLE || ((BLACKFIN || MIPS || SUPERH || FRV \
+		    || (PPC32 && PPC_MPC52xx)) && !SMP)

Please, do that as SUSPEND_UP_POSSIBLE, and make it look like

Quoted 4 lines
	config SUSPEND_UP_POSSIBLE
		depends on BLACKFIN || MIPS || SUPERH || FRV || ((PPC32 && PPC_MPC52xx)
		depends on !SMP
		default y

OK

Quoted 9 lines

and now you can write the above thing as

	depends on SUSPEND_SMP_POSSIBLE || SUSPEND_UP_POSSIBLE

and it's all much nicer.

I would say that doing a similar setup for HIBERNATE would be nice too, but the SUSPEND case is more noticeable because the SMP case is so nice already.

I did it symmetrically for suspend and hibernation and renamed SUSPEND_SMP to PM_SLEEP_SMP. Patch follows.

Greetings,
Rafael

---
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 PPC64_SWSUSP is set).

---
 kernel/power/Kconfig |   40 ++++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)
kernel/power/Kconfig +30 -10
Index: linux-2.6/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,45 @@ config PM_SLEEP
 	depends on SUSPEND || HIBERNATION
 	default y
 
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on BLACKFIN || MIPS || SUPERH || FRV || (PPC32 && PPC_MPC52xx)
+	depends on !SMP
+	default y
+
+config SUSPEND_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) \
+		   || (PPC64 && (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
reviewer
#4 lore raw
Quoted 72 lines · Rafael J. Wysocki
Quoted 9 lines · Linus Torvalds

kernel/power/Kconfig config PM_SLEEP

Quoted 4 lines · Rafael J. Wysocki
kernel/power/Kconfig +2 -1
 	depends on PM
-	depends on !SMP || SUSPEND_SMP_POSSIBLE
+	depends on SUSPEND_SMP_POSSIBLE || ((BLACKFIN || MIPS || SUPERH || FRV \
+		    || (PPC32 && PPC_MPC52xx)) && !SMP)

Please, do that as SUSPEND_UP_POSSIBLE, and make it look like

Quoted 4 lines
	config SUSPEND_UP_POSSIBLE
		depends on BLACKFIN || MIPS || SUPERH || FRV || ((PPC32 && PPC_MPC52xx)
		depends on !SMP
		default y

OK

Quoted 9 lines

and now you can write the above thing as

	depends on SUSPEND_SMP_POSSIBLE || SUSPEND_UP_POSSIBLE

and it's all much nicer.

I would say that doing a similar setup for HIBERNATE would be nice too, but the SUSPEND case is more noticeable because the SMP case is so nice already.

I did it symmetrically for suspend and hibernation and renamed SUSPEND_SMP to PM_SLEEP_SMP. Patch follows.

Greetings,
Rafael

---
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 PPC64_SWSUSP is set).

---
 kernel/power/Kconfig |   40 ++++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)

Index: linux-2.6/kernel/power/Kconfig
===================================================================

kernel/power/Kconfig +3 -8
@@ -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
 

kernel/power/Kconfig config PM_SLEEP · line 89

Quoted 6 lines
kernel/power/Kconfig +3 -0
@@ -89,20 +84,45 @@ config PM_SLEEP
 	depends on SUSPEND || HIBERNATION
 	default y
 
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on BLACKFIN || MIPS || SUPERH || FRV || (PPC32 && PPC_MPC52xx)

please include (X86 && !X86_VOYAGER) here -- else you'll disable SUSPEND from all X86 when built UP.

thanks,
-Len

#5 lore raw
Quoted 3 lines · Len Brown
Quoted 2 lines · Rafael J. Wysocki
Quoted 1 line · Linus Torvalds

On Fri, 3 Aug 2007, Rafael J. Wysocki wrote:

[--snip--]

Quoted 7 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on BLACKFIN || MIPS || SUPERH || FRV || (PPC32 && PPC_MPC52xx)

please include (X86 && !X86_VOYAGER) here -- else you'll disable SUSPEND from all X86 when built UP.

Right. I think I should include everything that can do SMP suspend here.

Updated patch is appended.

Greetings,
Rafael

---
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 PPC64_SWSUSP is set).

---
 kernel/power/Kconfig |   42 ++++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)
kernel/power/Kconfig +32 -10
Index: linux-2.6/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,47 @@ config PM_SLEEP
 	depends on SUSPEND || HIBERNATION
 	default y
 
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) || (PPC32 && PPC_MPC52xx) \
+		   || (PPC64 && (PPC_PSERIES || PPC_PMAC)) || ARM || BLACKFIN \
+		   || MIPS || SUPERH || FRV
+	depends on !SMP
+	default y
+
+config SUSPEND_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) \
+		   || (PPC64 && (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
#6 lore raw
Quoted 13 lines · Rafael J. Wysocki
Quoted 3 lines · Len Brown
Quoted 2 lines · Rafael J. Wysocki
Quoted 1 line · Linus Torvalds

On Fri, 3 Aug 2007, Rafael J. Wysocki wrote:

[--snip--]

Quoted 7 lines

kernel/power/Kconfig config PM_SLEEP

Quoted 4 lines
kernel/power/Kconfig +3 -0
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on BLACKFIN || MIPS || SUPERH || FRV || (PPC32 && PPC_MPC52xx)

please include (X86 && !X86_VOYAGER) here -- else you'll disable SUSPEND from all X86 when built UP.

Quoted 3 lines

Right. I think I should include everything that can do SMP suspend here.

Updated patch is appended.

Well, unfortunately, the patch below is buggy, because I need to change CONFIG_SUSPEND_SMP into CONFIG_PM_SLEEP_SMP in some more places.

I'll send an updated version in a new thread.

Greetings,
Rafael

Quoted 94 lines

---
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 PPC64_SWSUSP is set).

---
 kernel/power/Kconfig |   42 ++++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)

Index: linux-2.6/kernel/power/Kconfig
===================================================================

kernel/power/Kconfig +32 -11
@@ -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,47 @@ config PM_SLEEP
 	depends on SUSPEND || HIBERNATION
 	default y
 
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) || (PPC32 && PPC_MPC52xx) \
+		   || (PPC64 && (PPC_PSERIES || PPC_PMAC)) || ARM || BLACKFIN \
+		   || MIPS || SUPERH || FRV
+	depends on !SMP
+	default y
+
+config SUSPEND_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) \
+		   || (PPC64 && (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
-

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth
#7 lore raw
In reply to Len Brown
Quoted 3 lines · Len Brown
Quoted 2 lines · Rafael J. Wysocki
Quoted 1 line · Linus Torvalds

On Fri, 3 Aug 2007, Rafael J. Wysocki wrote:

[--snip--]

Quoted 7 lines

Review

Quoted 4 lines
(quoted diff) +3 -0
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on BLACKFIN || MIPS || SUPERH || FRV || (PPC32 && PPC_MPC52xx)

please include (X86 && !X86_VOYAGER) here -- else you'll disable SUSPEND from all X86 when built UP.

Right. I think I should include everything that can do SMP suspend here.

Updated patch is appended.

Greetings,
Rafael

---
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 PPC64_SWSUSP is set).

---
 kernel/power/Kconfig |   42 ++++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)
kernel/power/Kconfig +32 -10
Index: linux-2.6/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,47 @@ config PM_SLEEP
 	depends on SUSPEND || HIBERNATION
 	default y
 
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) || (PPC32 && PPC_MPC52xx) \
+		   || (PPC64 && (PPC_PSERIES || PPC_PMAC)) || ARM || BLACKFIN \
+		   || MIPS || SUPERH || FRV
+	depends on !SMP
+	default y
+
+config SUSPEND_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) \
+		   || (PPC64 && (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
#8 lore raw
In reply to Linus Torvalds
Quoted 9 lines · Linus Torvalds

Review

Quoted 4 lines · Rafael J. Wysocki
(quoted diff) +2 -1
 	depends on PM
-	depends on !SMP || SUSPEND_SMP_POSSIBLE
+	depends on SUSPEND_SMP_POSSIBLE || ((BLACKFIN || MIPS || SUPERH || FRV \
+		    || (PPC32 && PPC_MPC52xx)) && !SMP)

Please, do that as SUSPEND_UP_POSSIBLE, and make it look like

Quoted 4 lines
	config SUSPEND_UP_POSSIBLE
		depends on BLACKFIN || MIPS || SUPERH || FRV || ((PPC32 && PPC_MPC52xx)
		depends on !SMP
		default y

OK

Quoted 9 lines

and now you can write the above thing as

	depends on SUSPEND_SMP_POSSIBLE || SUSPEND_UP_POSSIBLE

and it's all much nicer.

I would say that doing a similar setup for HIBERNATE would be nice too, but the SUSPEND case is more noticeable because the SMP case is so nice already.

I did it symmetrically for suspend and hibernation and renamed SUSPEND_SMP to PM_SLEEP_SMP. Patch follows.

Greetings,
Rafael

---
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 PPC64_SWSUSP is set).

---
 kernel/power/Kconfig |   40 ++++++++++++++++++++++++++++++----------
 1 file changed, 30 insertions(+), 10 deletions(-)
kernel/power/Kconfig +30 -10
Index: linux-2.6/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,45 @@ config PM_SLEEP
 	depends on SUSPEND || HIBERNATION
 	default y
 
+config SUSPEND_UP_POSSIBLE
+	bool
+	depends on BLACKFIN || MIPS || SUPERH || FRV || (PPC32 && PPC_MPC52xx)
+	depends on !SMP
+	default y
+
+config SUSPEND_SMP_POSSIBLE
+	bool
+	depends on (X86 && !X86_VOYAGER) \
+		   || (PPC64 && (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