2003-07-26 19:47:58

by Tomas Szepe

[permalink] [raw]
Subject: [TRIVIAL] sanitize power management config menus

$subj

patch against -bk3.

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


2003-07-27 02:34:22

by Randy.Dunlap

[permalink] [raw]
Subject: Re: [TRIVIAL] sanitize power management config menus



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/

2003-07-27 02:41:38

by Tomas Szepe

[permalink] [raw]
Subject: Re: [TRIVIAL] sanitize power management config menus

> [[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.

> 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.

> 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.

--
Tomas Szepe <[email protected]>

2003-07-27 02:45:06

by Linus Torvalds

[permalink] [raw]
Subject: Re: [TRIVIAL] sanitize power management config menus


On Sat, 26 Jul 2003, Randy.Dunlap wrote:
>
> 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

2003-07-27 03:33:57

by Randy.Dunlap

[permalink] [raw]
Subject: Re: [TRIVIAL] sanitize power management config menus

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(-


diff -Naur ./arch/i386/Kconfig~swshelp ./arch/i386/Kconfig
--- ./arch/i386/Kconfig~swshelp 2003-07-25 10:23:11.000000000 -0700
+++ ./arch/i386/Kconfig 2003-07-26 20:30:50.000000000 -0700
@@ -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.
diff -Naur ./arch/x86_64/Kconfig~swshelp ./arch/x86_64/Kconfig
--- ./arch/x86_64/Kconfig~swshelp 2003-07-13 20:37:13.000000000 -0700
+++ ./arch/x86_64/Kconfig 2003-07-26 20:31:04.000000000 -0700
@@ -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

2003-07-27 04:31:22

by Rahul Karnik

[permalink] [raw]
Subject: Re: [TRIVIAL] sanitize power management config menus

Randy.Dunlap wrote:

> + 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

2003-07-27 05:43:19

by Matias Alejo Garcia

[permalink] [raw]
Subject: Re: [TRIVIAL] sanitize power management config menus

On Sat, 2003-07-26 at 22:46, Randy.Dunlap wrote:
> 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
--
Matias Alejo Garcia <[email protected]>

2003-07-27 06:42:03

by Tomas Szepe

[permalink] [raw]
Subject: Re: [TRIVIAL] sanitize power management config menus

> | > 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).

--
Tomas Szepe <[email protected]>

2003-07-27 11:29:59

by Pavel Machek

[permalink] [raw]
Subject: Re: [TRIVIAL] sanitize power management config menus

Hi!

> | > 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.

> --- ./arch/i386/Kconfig~swshelp 2003-07-25 10:23:11.000000000 -0700
> +++ ./arch/i386/Kconfig 2003-07-26 20:30:50.000000000 -0700
> @@ -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

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

> + 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.

> - 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.

> - 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.

--
Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...

2003-07-27 11:52:31

by Tomas Szepe

[permalink] [raw]
Subject: Re: [TRIVIAL] sanitize power management config menus

> > + 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.

> > 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.

> > - 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.

> > - 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.

--
Tomas Szepe <[email protected]>