PM: Acquire device locks on suspend
authorRafael J. Wysocki <rjw@sisk.pl>
Sat, 12 Jan 2008 19:40:46 +0000 (20:40 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 25 Jan 2008 04:40:04 +0000 (20:40 -0800)
commit775b64d2b6ca37697de925f70799c710aab5849a
tree09e91c89228c8d3c6928a1b2ef56711190c69836
parent7a83d456a86d559a6347115d206d23774bc152d9
PM: Acquire device locks on suspend

This patch reorganizes the way suspend and resume notifications are
sent to drivers.  The major changes are that now the PM core acquires
every device semaphore before calling the methods, and calls to
device_add() during suspends will fail, while calls to device_del()
during suspends will block.

It also provides a way to safely remove a suspended device with the
help of the PM core, by using the device_pm_schedule_removal() callback
introduced specifically for this purpose, and updates two drivers (msr
and cpuid) that need to use it.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/cpuid.c
arch/x86/kernel/msr.c
drivers/base/core.c
drivers/base/power/main.c
drivers/base/power/power.h
include/linux/device.h