alistair23-linux/drivers/base
Rafael J. Wysocki 58aca23226 PM: Handle device registrations during suspend/resume
Modify the PM core to protect its data structures, specifically the
dpm_active list, from being corrupted if a child of the currently
suspending device is registered concurrently with its ->suspend()
callback.  In that case, since the new device (the child) is added
to dpm_active after its parent, the PM core will attempt to
suspend it after the parent, which is wrong.

Introduce a new member of struct dev_pm_info, called 'sleeping',
and use it to check if the parent of the device being added to
dpm_active has been suspended, in which case the device registration
fails.  Also, use 'sleeping' for checking if the ordering of devices
on dpm_active is correct.

Introduce variable 'all_sleeping' that will be set to 'true' once all
devices have been suspended and make new device registrations fail
until 'all_sleeping' is reset to 'false', in order to avoid having
unsuspended devices around while the system is going into a sleep state.

Remove pm_sleep_rwsem which is not necessary any more.

Special thanks to Alan Stern for discussions and suggestions that
lead to the creation of this patch.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-04-19 19:10:24 -07:00
..
power PM: Handle device registrations during suspend/resume 2008-04-19 19:10:24 -07:00
attribute_container.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2008-01-25 17:19:08 -08:00
base.h Driver core: coding style fixes 2008-01-24 22:50:12 -08:00
bus.c Driver core: Fix error handling in bus_add_driver(). 2008-02-21 15:27:07 -08:00
class.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-2.6 2008-01-31 09:31:37 +11:00
core.c PM: Handle device registrations during suspend/resume 2008-04-19 19:10:24 -07:00
cpu.c driver core: cpu: fix section mismatch in cpu.c:store_online 2008-04-19 19:10:23 -07:00
dd.c Driver core: coding style fixes 2008-01-24 22:50:12 -08:00
devres.c
dma-mapping.c
driver.c driver core: fix small mem leak in driver_add_kobj() 2008-03-28 14:45:23 -07:00
firmware.c firmware: change firmware_kset to firmware_kobj 2008-01-24 20:40:23 -08:00
firmware_class.c Driver core: Revert "Fix Firmware class name collision" 2008-02-07 11:31:46 -08: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
Kconfig
Makefile Merge branch 'dmapool' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc 2008-02-05 19:05:48 -08:00
map.c
memory.c driver core: register_memory/unregister_memory clean ups and bugfix 2008-04-19 19:10:19 -07:00
module.c Driver core: move the static kobject out of struct driver 2008-01-24 20:40:35 -08:00
node.c Driver core: change sysdev classes to use dynamic kobject names 2008-01-24 20:40:40 -08:00
platform.c drivers: fix dma_get_required_mask 2008-03-10 16:33:33 -07:00
sys.c sysdev: detect multiple driver registrations 2008-04-19 19:10:24 -07:00
topology.c
transport_class.c [SCSI] transport_class: BUG if we can't release the attribute container 2008-04-07 12:19:10 -05:00