Skip to contentSkip to conversation

sanitize power management config menus

TRIVIAL Tomas Szepe 6 participants 10 messages Jul 26, 2003 – Jul 27, 2003

lore
Share & tools
lore
#0 lore raw

$subj

patch against -bk3.

Signature · 62 lines
Tomas Szepe <[email protected]>


diff -urN a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/i386/kernel/cpu/cpufreq/Kconfig
--- a/arch/i386/kernel/cpu/cpufreq/Kconfig	2003-07-10 23:30:33.000000000 +0200
+++ b/arch/i386/kernel/cpu/cpufreq/Kconfig	2003-07-26 21:37:13.000000000 +0200
@@ -2,10 +2,9 @@
 # CPU Frequency scaling
 #
 
-menu "CPU Frequency scaling"
-
 config CPU_FREQ
 	bool "CPU Frequency scaling"
+	depends on PM
 	help
 	  Clock scaling allows you to change the clock speed of CPUs on the
 	  fly. This is a nice method to save battery power on notebooks,
@@ -16,6 +15,8 @@
 
 	  If in doubt, say N.
 
+if CPU_FREQ
+
 source "drivers/cpufreq/Kconfig"
 
 config CPU_FREQ_TABLE
@@ -162,4 +163,4 @@
 
 	  If in doubt, say N.
 
-endmenu
+endif
diff -urN a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
--- a/drivers/acpi/Kconfig	2003-06-22 22:27:39.000000000 +0200
+++ b/drivers/acpi/Kconfig	2003-07-26 21:34:05.000000000 +0200
@@ -2,7 +2,7 @@
 # ACPI Configuration
 #
 
-menu "ACPI Support"
+if PM
 
 config ACPI
 	bool "ACPI Support" if X86
@@ -36,6 +36,8 @@
 	  available at:
 	  <http://www.acpi.info>
 
+if ACPI
+
 config ACPI_HT_ONLY
 	bool "CPU Enumeration Only"
 	depends on X86 && ACPI && X86_LOCAL_APIC
@@ -236,5 +238,6 @@
 	depends on IA64 && (!IA64_HP_SIM || IA64_SGI_SN)
 	default y
 
-endmenu
+endif
 
+endif
#1 lore raw

On Sat, 26 Jul 2003 22:02:13 +0200 Tomas Szepe <[email protected]> wrote:

| patch against -bk3.
| 
| -- 

This patch is mostly OK IMHO.

1. However, both old and new versions say:
Power management options (ACPI, APM) --->
but have Software Suspend and CPU Frequency (hidden) below there, so one has to know to look there for them, while the heading only says APCI and APM. I guess that the heading is too restrictive.

2. APM and ACPI aren't usable together, right? so should the Kconfig file prevent both of them from being enabled?

3. The help text for Software Suspend (not part of this patch) really needs some help. Would you address that or shall I?

Thanks,
--
~Randy
| http://developer.osdl.org/rddunlap/ | http://www.xenotime.net/linux/ | For Linux-2.6:
http://www.codemonkey.org.uk/post-halloween-2.5.txt
or http://lwn.net/Articles/39901/
http://www.kernel.org/pub/linux/kernel/people/rusty/modules/

#2 lore raw
Quoted 7 lines

[[email protected]]

1. However, both old and new versions say:
Power management options (ACPI, APM) --->
but have Software Suspend and CPU Frequency (hidden) below there, so one has to know to look there for them, while the heading only says APCI and APM. I guess that the heading is too restrictive.

Yes, you're right, let's just kill the parentheses.

Quoted 2 lines

2. APM and ACPI aren't usable together, right? so should the Kconfig file prevent both of them from being enabled?

I'm not quite sure about this, though I believe that ACPI at least in the CPU-enum-only configuration makes sense even with APM enabled.

Quoted 2 lines

3. The help text for Software Suspend (not part of this patch) really needs some help. Would you address that or shall I?

Sure, it would be nice if you could fish out an entry from somewhere.

Signature · 1 line
Tomas Szepe <[email protected]>
#3 lore raw

On Sun, 27 Jul 2003 04:56:47 +0200 Tomas Szepe <[email protected]> wrote:

| > 3.  The help text for Software Suspend (not part of this patch)
| > really needs some help.  Would you address that or shall I?
| 
| Sure, it would be nice if you could fish out an entry from somewhere.

OK, how's this look?

--
~Randy

patch_name: sws_help.patch
patch_version: 2003-07-26.20:32:10
author: Randy.Dunlap <[email protected]>
description: make software_suspend help readable
product: Linux
product_versions: 2.6.0-test1
diffstat: =

 arch/i386/Kconfig   |   30 +++++++++++++++---------------
 arch/x86_64/Kconfig |   20 ++++++++++----------
 2 files changed, 25 insertions(+), 25 deletions(-
arch/i386/Kconfig renamed from arch/i386/Kconfig~swshelp +15 -15
diff -Naur ./arch/i386/Kconfig~swshelp ./arch/i386/Kconfig
@@ -824,27 +824,27 @@
 	bool "Software Suspend (EXPERIMENTAL)"
 	depends on EXPERIMENTAL && PM && SWAP
 	---help---
-	  Enable the possibilty of suspendig machine. It doesn't need APM.
-	  You may suspend your machine by 'swsusp' or 'shutdown -z <time>' 
-	  (patch for sysvinit needed). 
-
-	  It creates an image which is saved in your active swaps. By the next
-	  booting the, pass 'resume=/path/to/your/swap/file' and kernel will 
-	  detect the saved image, restore the memory from
-	  it and then it continues to run as before you've suspended.
-	  If you don't want the previous state to continue use the 'noresume'
-	  kernel option. However note that your partitions will be fsck'd and
-	  you must re-mkswap your swap partitions/files.
+	  Enable the possibility of suspending the machine. It doesn't need
+	  APM. You may suspend your machine by 'swsusp' or 'shutdown -z <time>'
+	  (patch for sysvinit is needed). 
+
+	  This creates an image which is saved in your active swap space. On
+	  the next boot, pass the 'resume=/path/to/your/swap/file' option and
+	  the kernel will detect the saved image, restore the memory from it,
+	  and then continue to run as before you suspended.
+	  If you don't want the previous state to continue, use the 'noresume'
+	  kernel option. However, note that your partitions will appear to be
+	  damaged so you must re-mkswap your swap partitions/files to use them.
 
 	  Right now you may boot without resuming and then later resume but
-	  in meantime you cannot use those swap partitions/files which were
+	  in the meantime you cannot use those swap partitions/files which were
 	  involved in suspending. Also in this case there is a risk that buffers
 	  on disk won't match with saved ones.
 
-	  SMP is supported ``as-is''. There's a code for it but doesn't work.
-	  There have been problems reported relating SCSI.
+	  SMP is supported ``as-is''. There's code for it but doesn't work.
+	  There have been problems reported relating to SCSI.
 
-	  This option is about getting stable. However there is still some
+	  This option is close to getting stable. However there is still some
 	  absence of features.
 
 	  For more information take a look at Documentation/swsusp.txt.
arch/x86_64/Kconfig renamed from arch/x86_64/Kconfig~swshelp +10 -10
diff -Naur ./arch/x86_64/Kconfig~swshelp ./arch/x86_64/Kconfig
@@ -300,17 +300,17 @@
 	bool "Software Suspend (EXPERIMENTAL)"
 	depends on EXPERIMENTAL && PM && SWAP
 	---help---
-	  Enable the possibilty of suspending the machine. It doesn't need APM.
-	  You may suspend your machine by 'swsusp' or 'shutdown -z <time>' 
-	  (patch for sysvinit needed). 
-
-	  It creates an image which is saved in your active swaps. On the next
-	  boot, pass the 'resume=/path/to/your/swap/file' option and the kernel
-	  will detect the saved image, restore the memory from
-	  it, and then continue to run as before you suspended.
+	  Enable the possibility of suspending the machine. It doesn't need
+	  APM. You may suspend your machine by 'swsusp' or 'shutdown -z <time>' 
+	  (patch for sysvinit is needed). 
+
+	  This creates an image which is saved in your active swap space. On
+	  the next boot, pass the 'resume=/path/to/your/swap/file' option and
+	  the kernel will detect the saved image, restore the memory from it,
+	  and then continue to run as before you suspended.
 	  If you don't want the previous state to continue, use the 'noresume'
-	  kernel option. However, note that your partitions will be fsck'd and
-	  you must re-mkswap your swap partitions/files.
+	  kernel option. However, note that your partitions will appear to be
+	  damaged so you must re-mkswap your swap partitions/files to use them.
 
 	  Right now you may boot without resuming and then later resume but
 	  in the meantime you cannot use those swap partitions/files which were
#4 lore raw

arch/i386/Kconfig line 834

Quoted 4 lines · Randy.Dunlap
arch/i386/Kconfig renamed from arch/i386/Kconfig~swshelp +4 -0
+	  This creates an image which is saved in your active swap space. On
+	  the next boot, pass the 'resume=/path/to/your/swap/file' option and
+	  the kernel will detect the saved image, restore the memory from it,
+	  and then continue to run as before you suspended.

Couple of points/questions:

- Is it possible to make swsusp use a dedicated hibernate partition, for better interoperability with Windows? I was thinking of the dual boot situation, where I would like a laptop to boot whatever OS was booted last. And how does s4bios fit in?

- Perhaps we can mention in the help text that swsusp performs a function similar to hibernate, and different from the APM suspend operation, with corresponding power savings.

Thanks,
Rahul

#5 lore raw
In reply to Randy.Dunlap
Quoted 6 lines
| > 3.  The help text for Software Suspend (not part of this patch)
| > really needs some help.  Would you address that or shall I?
| 
| Sure, it would be nice if you could fish out an entry from somewhere.

OK, how's this look?

Looks good to me. IMHO it would be appropriate to put the two (identical) swsusp entries in a single Kconfig file and reference that from the arch Kconfigs, though (while you're at it :D).

Signature · 1 line
Tomas Szepe <[email protected]>
#6 lore raw
In reply to Randy.Dunlap

Hi!

Quoted 6 lines
| > 3.  The help text for Software Suspend (not part of this patch)
| > really needs some help.  Would you address that or shall I?
| 
| Sure, it would be nice if you could fish out an entry from somewhere.

OK, how's this look?

Hey, I had similar patch in queue somewhere.

Quoted 13 lines
arch/i386/Kconfig renamed from arch/i386/Kconfig~swshelp +0 -7
@@ -824,27 +824,27 @@
 	bool "Software Suspend (EXPERIMENTAL)"
 	depends on EXPERIMENTAL && PM && SWAP
 	---help---
-	  Enable the possibilty of suspendig machine. It doesn't need APM.
-	  You may suspend your machine by 'swsusp' or 'shutdown -z <time>' 
-	  (patch for sysvinit needed). 
-
-	  It creates an image which is saved in your active swaps. By the next
-	  booting the, pass 'resume=/path/to/your/swap/file' and kernel will 
-	  detect the saved image, restore the memory from

arch/i386/Kconfig line 832

Quoted 10 lines
arch/i386/Kconfig renamed from arch/i386/Kconfig~swshelp +6 -4
-	  it and then it continues to run as before you've suspended.
-	  If you don't want the previous state to continue use the 'noresume'
-	  kernel option. However note that your partitions will be fsck'd and
-	  you must re-mkswap your swap partitions/files.
+	  Enable the possibility of suspending the machine. It doesn't need
+	  APM. You may suspend your machine by 'swsusp' or 'shutdown -z <time>'
+	  (patch for sysvinit is needed). 
+
+	  This creates an image which is saved in your active swap space. On
+	  the next boot, pass the 'resume=/path/to/your/swap/file' option and

Swap *files* are no longer supported. Swap partitions work.

arch/i386/Kconfig line 842

Quoted 11 lines
arch/i386/Kconfig renamed from arch/i386/Kconfig~swshelp +6 -1
+	  the kernel will detect the saved image, restore the memory from it,
+	  and then continue to run as before you suspended.
+	  If you don't want the previous state to continue, use the 'noresume'
+	  kernel option. However, note that your partitions will appear to be
+	  damaged so you must re-mkswap your swap partitions/files to use them.
 
 	  Right now you may boot without resuming and then later resume but
-	  in meantime you cannot use those swap partitions/files which were
+	  in the meantime you cannot use those swap partitions/files which were
 	  involved in suspending. Also in this case there is a risk that buffers
 	  on disk won't match with saved ones.

I guess we do not want to teach people doing this.

arch/i386/Kconfig line 845

Quoted 4 lines
arch/i386/Kconfig renamed from arch/i386/Kconfig~swshelp +2 -2
-	  SMP is supported __as-is''. There's a code for it but doesn't work.
-	  There have been problems reported relating SCSI.
+	  SMP is supported __as-is''. There's code for it but doesn't work.
+	  There have been problems reported relating to SCSI.

SMP is not supported. Kill the note about SCSI.

arch/i386/Kconfig line 848

Quoted 3 lines
arch/i386/Kconfig renamed from arch/i386/Kconfig~swshelp +1 -1
-	  This option is about getting stable. However there is still some
+	  This option is close to getting stable. However there is still some
 	  absence of features.

Kill this. Saying (EXPERIMENTAL) should be enough.

Signature · 2 lines
				Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...
#7 lore raw
Quoted 4 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	  This creates an image which is saved in your active swap space. On
+	  the next boot, pass the 'resume=/path/to/your/swap/file' option and

Swap *files* are no longer supported. Swap partitions work.

Right.

Quoted 7 lines

arch/i386/Kconfig line 842

Quoted 5 lines
arch/i386/Kconfig renamed from arch/i386/Kconfig~swshelp +1 -1
 	  Right now you may boot without resuming and then later resume but
-	  in meantime you cannot use those swap partitions/files which were
+	  in the meantime you cannot use those swap partitions/files which were
 	  involved in suspending. Also in this case there is a risk that buffers
 	  on disk won't match with saved ones.

I guess we do not want to teach people doing this.

Right.

Quoted 6 lines

arch/i386/Kconfig line 845

Quoted 4 lines
arch/i386/Kconfig renamed from arch/i386/Kconfig~swshelp +2 -2
-	  SMP is supported __as-is''. There's a code for it but doesn't work.
-	  There have been problems reported relating SCSI.
+	  SMP is supported __as-is''. There's code for it but doesn't work.
+	  There have been problems reported relating to SCSI.

SMP is not supported. Kill the note about SCSI.

Ok.

Quoted 5 lines

arch/i386/Kconfig line 848

Quoted 3 lines
arch/i386/Kconfig renamed from arch/i386/Kconfig~swshelp +1 -1
-	  This option is about getting stable. However there is still some
+	  This option is close to getting stable. However there is still some
 	  absence of features.

Kill this. Saying (EXPERIMENTAL) should be enough.

Agreed.

I'll be sending a revised combined patch to clean up the power management menu in a minute, will CC.

Signature · 1 line
Tomas Szepe <[email protected]>
#8 lore raw
In reply to Randy.Dunlap
Quoted 3 lines · Randy.Dunlap

2. APM and ACPI aren't usable together, right? so should the Kconfig file prevent both of them from being enabled?

They aren't used at the same time (as power management, at least), but they should be usable together (ACPI doing things like CPU enumeration, APM doing sleeps), and even more importantly, you should be able to compile both, and if ACPI is disabled or the BIOS doesn't have an ACPI table, the power management should just fall back to APM.

So they definitely aren't supposed to be mutually exclusive from a configuration standpoint.

Linus

#9 lore raw
In reply to Randy.Dunlap
Quoted 2 lines · Randy.Dunlap

2. APM and ACPI aren't usable together, right? so should the Kconfig file prevent both of them from being enabled?

No. It is good to have both compiled in the kernel and to choose thru kernel parms which to use, or to have them in modules.

matías

Signature · 1 line
Matias Alejo Garcia <[email protected]>