linux/kernel
Rafael J. Wysocki 2391dae3e3 PM: introduce set_target method in pm_ops
Commit 52ade9b3b9 changed the suspend code
ordering to execute pm_ops->prepare() after the device model per-device
.suspend() calls in order to fix some ACPI-related issues.  Unfortunately, it
broke the at91 platform which assumed that pm_ops->prepare() would be called
before suspending devices.

at91 used pm_ops->prepare() to get notified of the target system sleep state,
so that it could use this information while suspending devices.  However, with
the current suspend code ordering pm_ops->prepare() is called too late for
this purpose.  Thus, at91 needs an additional method in 'struct pm_ops' that
will be used for notifying the platform of the target system sleep state.
Moreover, in the future such a method will also be needed by ACPI.

This patch adds the .set_target() method to 'struct pm_ops' and makes the
suspend code call it, if implemented, before executing the device model
per-device .suspend() calls.  It also modifies the at91 code to use
pm_ops->set_target() instead of pm_ops->prepare().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Len Brown <lenb@kernel.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-01 12:29:44 -07:00
..
irq Fix crash with irqpoll due to the IRQF_IRQPOLL flag testing 2007-05-24 08:37:14 -07:00
power PM: introduce set_target method in pm_ops 2007-07-01 12:29:44 -07:00
time timer stats: speedups 2007-06-01 08:18:30 -07:00
.gitignore
Kconfig.hz
Kconfig.preempt
Makefile
acct.c
audit.c
audit.h
auditfilter.c audit: fix oops removing watch if audit disabled 2007-06-24 08:59:12 -07:00
auditsc.c
capability.c
compat.c
configs.c
cpu.c
cpuset.c cpuset: zero malloc - fix for old cpusets 2007-06-16 13:16:15 -07:00
delayacct.c
die_notifier.c
dma.c
exec_domain.c
exit.c pi-futex: fix exit races and locking problems 2007-06-08 17:23:34 -07:00
extable.c
fork.c freezer: fix vfork problem 2007-05-23 20:14:11 -07:00
futex.c FUTEX: Restore the dropped ERSCH fix 2007-06-24 12:08:53 -07:00
futex_compat.c Revert "futex_requeue_pi optimization" 2007-06-18 09:48:41 -07:00
hrtimer.c
itimer.c
kallsyms.c fix possible null ptr deref in kallsyms_lookup 2007-05-30 10:51:38 -07:00
kexec.c
kfifo.c
kmod.c
kprobes.c
ksysfs.c
kthread.c freezer: fix kthread_create vs freezer theoretical race 2007-05-23 20:14:11 -07:00
latency.c
lockdep.c
lockdep_internals.h
lockdep_proc.c
module.c
mutex-debug.c
mutex-debug.h
mutex.c
mutex.h
nsproxy.c fix refcounting of nsproxy object when unshared 2007-06-24 08:59:10 -07:00
panic.c
params.c
pid.c
posix-cpu-timers.c
posix-timers.c posix-timers: Prevent softirq starvation by small intervals and SIG_IGN 2007-06-21 15:57:04 -07:00
printk.c
profile.c Detach sched.h from mm.h 2007-05-21 09:18:19 -07:00
ptrace.c
rcupdate.c
rcutorture.c
relay.c relayfs: fix overwrites 2007-06-28 11:38:18 -07:00
resource.c
rtmutex-debug.c
rtmutex-debug.h
rtmutex-tester.c
rtmutex.c Revert "futex_requeue_pi optimization" 2007-06-18 09:48:41 -07:00
rtmutex.h
rtmutex_common.h Revert "futex_requeue_pi optimization" 2007-06-18 09:48:41 -07:00
rwsem.c
sched.c sched: fix next_interval determination in idle_balance() 2007-06-24 08:59:11 -07:00
seccomp.c
signal.c Fix signalfd interaction with thread-private signals 2007-06-18 10:18:32 -07:00
softirq.c
softlockup.c
spinlock.c
srcu.c
stacktrace.c
stop_machine.c
sys.c
sys_ni.c
sysctl.c
taskstats.c
time.c
timer.c NOHZ: prevent multiplication overflow - stop timer for huge timeouts 2007-05-29 18:11:10 -07:00
tsacct.c
uid16.c
user.c
utsname.c
utsname_sysctl.c
wait.c
workqueue.c simplify cleanup_workqueue_thread() 2007-05-23 20:14:13 -07:00