OpenCloudOS-Kernel/drivers/base
Rafael J. Wysocki 1eede070a5 Introduce new top level suspend and hibernation callbacks
Introduce 'struct pm_ops' and 'struct pm_ext_ops' ('ext' meaning
'extended') representing suspend and hibernation operations for bus
types, device classes, device types and device drivers.

Modify the PM core to use 'struct pm_ops' and 'struct pm_ext_ops'
objects, if defined, instead of the ->suspend(), ->resume(),
->suspend_late(), and ->resume_early() callbacks (the old callbacks
will be considered as legacy and gradually phased out).

The main purpose of doing this is to separate suspend (aka S2RAM and
standby) callbacks from hibernation callbacks in such a way that the
new callbacks won't take arguments and the semantics of each of them
will be clearly specified.  This has been requested for multiple
times by many people, including Linus himself, and the reason is that
within the current scheme if ->resume() is called, for example, it's
difficult to say why it's been called (ie. is it a resume from RAM or
from hibernation or a suspend/hibernation failure etc.?).

The second purpose is to make the suspend/hibernation callbacks more
flexible so that device drivers can handle more than they can within
the current scheme.  For example, some drivers may need to prevent
new children of the device from being registered before their
->suspend() callbacks are executed or they may want to carry out some
operations requiring the availability of some other devices, not
directly bound via the parent-child relationship, in order to prepare
for the execution of ->suspend(), etc.

Ultimately, we'd like to stop using the freezing of tasks for suspend
and therefore the drivers' suspend/hibernation code will have to take
care of the handling of the user space during suspend/hibernation.
That, in turn, would be difficult within the current scheme, without
the new ->prepare() and ->complete() callbacks.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2008-06-10 10:59:50 -07:00
..
power Introduce new top level suspend and hibernation callbacks 2008-06-10 10:59:50 -07:00
Kconfig Driver core: add CONFIG_UEVENT_HELPER_PATH 2007-10-12 14:51:01 -07:00
Makefile Merge branch 'dmapool' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc 2008-02-05 19:05:48 -08:00
attribute_container.c SCSI: convert struct class_device to struct device 2008-04-19 19:10:33 -07:00
base.h driver core: remove no longer used "struct class_device" 2008-04-30 16:52:49 -07:00
bus.c bus_remove_device: be more careful about incomplete initialization 2008-04-22 17:40:36 -07:00
class.c Driver core: struct class remove children list 2008-05-14 10:37:58 -07:00
core.c driver-core: prepare for 2.6.27 api change by adding dev_set_name 2008-05-29 21:10:01 -07:00
cpu.c cpu: change cpu_sys_devices from array to per_cpu variable 2008-05-01 08:04:02 -07:00
dd.c driver core: replace remaining __FUNCTION__ occurrences 2008-04-19 19:10:29 -07:00
devres.c Driver core: fix devres_release_all() return value 2007-07-11 16:09:02 -07:00
dma-mapping.c devres: device resource management 2007-02-09 17:39:36 -05:00
driver.c driver core: warn about duplicate driver names on the same bus 2008-04-30 16:52:47 -07:00
firmware.c firmware: change firmware_kset to firmware_kobj 2008-01-24 20:40:23 -08:00
firmware_class.c firmware loader: printk when requesting firmware 2008-04-29 08:06:05 -07:00
hypervisor.c kobject: convert /sys/hypervisor to use kobject_create 2008-01-24 20:40:15 -08:00
init.c Driver core: coding style fixes 2008-01-24 22:50:12 -08:00
isa.c [PATCH] Driver model: add ISA bus 2006-06-21 12:40:49 -07:00
map.c [PATCH] kobj_map semaphore to mutex conversion 2006-03-20 13:42:58 -08:00
memory.c memory: Introduce exports for memory notifiers 2008-05-13 01:31:38 -04:00
module.c Driver core: move the static kobject out of struct driver 2008-01-24 20:40:35 -08:00
node.c mm: Add NR_WRITEBACK_TEMP counter 2008-04-30 08:29:50 -07:00
platform.c drivers: fix dma_get_required_mask 2008-03-10 16:33:33 -07:00
sys.c Fix bogus warning in sysdev_driver_register() 2008-05-06 13:22:42 -07:00
topology.c cpumask: use new cpus_scnprintf function 2008-04-19 19:44:59 +02:00
transport_class.c SCSI: convert struct class_device to struct device 2008-04-19 19:10:33 -07:00