Re: [linux-pm] Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
On Tuesday, 31 July 2007 11:16, Oliver Neukum wrote: > Am Dienstag 31 Juli 2007 schrieb Rafael J. Wysocki: > > > Well, the people on linux-pm seem to agree that the .suspend() and .resume() > > callbacks are not suitable for runtime power management, so having them > > built without SUSPEND or HIBERNATION wouldn't be very useful. ;-) > > These are what USB runtime power management uses. To be precise, I think the rule should be that if some code is needed for anything else than suspend/hibernation, it should be under plain CONFIG_PM. Still, if something is only needed for suspend/hibernation, it should go under CONFIG_PM_SLEEP or CONFIG_SUSPEND/HIBERNATION, depending on what it's needed for. Now, AFAICS, for the majority of drivers .suspend() and .resume() are only needed for suspend/hibernation and really should be used for suspending only (some other callbacks are needed for hibernation). > How many code paths for power management do you want to introduce? At least one more, for hibernation. That also depends on what approach to the runtime power management is widely accepted. For now, USB is in the vanguard. :-) Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth - 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/
Re: [linux-pm] Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
Am Dienstag 31 Juli 2007 schrieb Rafael J. Wysocki: > Well, the people on linux-pm seem to agree that the .suspend() and .resume() > callbacks are not suitable for runtime power management, so having them > built without SUSPEND or HIBERNATION wouldn't be very useful. ;-) These are what USB runtime power management uses. How many code paths for power management do you want to introduce? Regards Oliver - 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/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
On Tuesday, 31 July 2007 06:59, Len Brown wrote: > On Sunday 29 July 2007 17:27, Rafael J. Wysocki wrote: > > Still, there are many other files in which CONFIG_PM can be replaced > > with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in > > the future. > > There is #ifdef CONFIG_PM > around all the .suspend and .resume methods. > > Technically they are PM_DEVICE_STATES or something, > that could really be under PM, and both SUSPEND and HIBERNATE > would depend on PM_DEVICE_STATES, but it is also possible to have > PM_DEVICE_STATES without SUSPEND and HIBERNATE. Well, the people on linux-pm seem to agree that the .suspend() and .resume() callbacks are not suitable for runtime power management, so having them built without SUSPEND or HIBERNATION wouldn't be very useful. ;-) Greetings, Rafael -- "Premature optimization is the root of all evil." - Donald Knuth - 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/
Re: [PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
On Sunday 29 July 2007 17:27, Rafael J. Wysocki wrote: > Still, there are many other files in which CONFIG_PM can be replaced > with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in > the future. There is #ifdef CONFIG_PM around all the .suspend and .resume methods. Technically they are PM_DEVICE_STATES or something, that could really be under PM, and both SUSPEND and HIBERNATE would depend on PM_DEVICE_STATES, but it is also possible to have PM_DEVICE_STATES without SUSPEND and HIBERNATE. oh no, I just suggested more instead of fewer config options:-O but i agree, this can wait a bit... -Len - 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/
[PATCH 2/2] Introduce CONFIG_SUSPEND (updated)
From: Rafael J. Wysocki <[EMAIL PROTECTED]> Introduce CONFIG_SUSPEND representing the ability to enter system sleep states, such as the ACPI S3 state, and allow the user to choose SUSPEND and HIBERNATION independently of each other. Make HOTPLUG_CPU be selected automatically if SUSPEND or HIBERNATION has been chosen and the kernel is intended for SMP systems. Also, introduce CONFIG_PM_SLEEP which is automatically selected if CONFIG_SUSPEND or CONFIG_HIBERNATION is set and use it to select the code needed for both suspend and hibernation. The top-level power management headers and the ACPI code related to suspend and hibernation are modified to use the new definitions (the changes in drivers/acpi/sleep/main.c are, mostly, moving code to reduce the number of ifdefs). Still, there are many other files in which CONFIG_PM can be replaced with CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in the future. Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]> --- drivers/acpi/Kconfig|8 +++ drivers/acpi/sleep/Makefile |2 drivers/acpi/sleep/main.c | 94 +++- drivers/acpi/sleep/proc.c | 10 ++-- drivers/acpi/sleep/sleep.h |2 drivers/base/power/Makefile |2 drivers/base/power/power.h |4 - include/acpi/acpi_bus.h |9 include/acpi/acpi_drivers.h |4 + include/linux/freezer.h |6 +- include/linux/pm.h | 15 +-- include/linux/suspend.h | 10 ++-- kernel/power/Kconfig| 39 ++ kernel/power/Makefile |3 - kernel/power/main.c | 26 kernel/power/power.h| 10 mm/page_alloc.c |4 - 17 files changed, 163 insertions(+), 85 deletions(-) Index: linux-2.6/kernel/power/Kconfig === --- linux-2.6.orig/kernel/power/Kconfig 2007-07-29 19:06:26.0 +0200 +++ linux-2.6/kernel/power/Kconfig 2007-07-29 19:06:48.0 +0200 @@ -46,7 +46,7 @@ config PM_VERBOSE config DISABLE_CONSOLE_SUSPEND bool "Keep console(s) enabled during suspend/resume (DANGEROUS)" - depends on PM_DEBUG + depends on PM_DEBUG && PM_SLEEP default n ---help--- This option turns off the console suspend mechanism that prevents @@ -57,7 +57,7 @@ config DISABLE_CONSOLE_SUSPEND config PM_TRACE bool "Suspend/resume event tracing" - depends on PM_DEBUG && X86 && EXPERIMENTAL + depends on PM_DEBUG && X86 && PM_SLEEP && EXPERIMENTAL default n ---help--- This enables some cheesy code to save the last PM event point in the @@ -72,9 +72,37 @@ 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 + bool + depends on SUSPEND_SMP_POSSIBLE && PM_SLEEP + select HOTPLUG_CPU + default y + +config PM_SLEEP + bool + depends on SUSPEND || HIBERNATION + default y + +config SUSPEND + bool "Suspend to RAM and standby" + depends on PM + depends on !SMP || 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 bool "Hibernation" - depends on PM && SWAP && (((X86 || PPC64_SWSUSP) && (!SMP || SUSPEND_SMP)) || ((FRV || PPC32) && !SMP)) + depends on PM && SWAP + depends on ((X86 || PPC64_SWSUSP || FRV || PPC32) && !SMP) || SUSPEND_SMP_POSSIBLE ---help--- Enable the suspend to disk (STD) functionality, which is usually called "hibernation" in user interfaces. STD checkpoints the @@ -132,11 +160,6 @@ config PM_STD_PARTITION suspended image to. It will simply pick the first available swap device. -config SUSPEND_SMP - bool - depends on HOTPLUG_CPU && (X86 || PPC64) && PM - default y - config APM_EMULATION tristate "Advanced Power Management Emulation" depends on PM && SYS_SUPPORTS_APM_EMULATION Index: linux-2.6/kernel/power/Makefile === --- linux-2.6.orig/kernel/power/Makefile2007-07-29 19:06:26.0 +0200 +++ linux-2.6/kernel/power/Makefile 2007-07-29 19:06:48.0 +0200 @@ -3,8 +3,9 @@ ifeq ($(CONFIG_PM_DEBUG),y) EXTRA_CFLAGS += -DDEBUG endif -obj-y := main.o process.o console.o +obj-y := main.o obj-$(CONFIG_PM_LEGACY)+= pm.o +obj-$(CONFIG_PM_SLEEP) += process.o c