[Please consider as 2.6.22 material.]
---
From: Rafael J. Wysocki <rjw@sisk.pl>Commit 52ade9b3b97fd3bea42842a056fe0786c28d0555 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 implement
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>
---
arch/arm/mach-at91/pm.c | 4 +-
include/linux/pm.h | 66 +++++++++++++++++++++++++++++++++++-------------
kernel/power/main.c | 6 +++-
3 files changed, 56 insertions(+), 20 deletions(-)Index: linux-2.6.22-rc6/include/linux/pm.h
===================================================================
--- linux-2.6.22-rc6.orig/include/linux/pm.h 2007-06-25 21:09:18.000000000 +0200
+++ linux-2.6.22-rc6/include/linux/pm.h 2007-06-25 21:09:30.000000000 +0200
@@ -110,37 +110,67 @@ typedef int __bitwise suspend_state_t;
#define PM_SUSPEND_MAX ((__force suspend_state_t) 4)/**
- * struct pm_ops - Callbacks for managing platform dependent suspend states.
- * @valid: Callback to determine whether the given sta...
On Wed, 27 Jun 2007 23:56:28 +0200
The patch tries to patch the function suspend_devices_and_enter() which is
introduced by pm-reduce-code-duplication-between-mainc-and-userc.patch,-
Oh, thanks for spotting that, I've overlooked it. Sorry.
The updated version below is on top of vanilla 2.6.22-rc6. It's almost the
same as the original one except for the 'goto Thaw' in suspend_prepare()
(instead of 'return error' which would be wrong).It breaks pm-reduce-code-duplication-between-mainc-and-userc.patch quite a bit,
but I'll rework and resend that patch in a while (please drop it for now).Greetings,
Rafael---
From: Rafael J. Wysocki <rjw@sisk.pl>Commit 52ade9b3b97fd3bea42842a056fe0786c28d0555 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>
---
arch/arm/mach-at91/pm.c | 4 +-
include/linux/pm.h | 66 +++++++++++++++++++++++++++++++++++-------------
kernel/power/main.c | 6 +++-
3 files changed, 56 insertions(+), 20 deletions(-)Index: linux-2.6.22-rc6/include/linux/pm.h
===================================================================
--- linux-2.6.2...
| Linus Torvalds | Linux 2.6.27-rc5 |
| Jared Hulbert | [PATCH 00/10] AXFS: Advanced XIP filesystem |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Linus Torvalds | Linux 2.6.27-rc8 |
git: | |
| David Miller | [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Mark McLoughlin | [PATCH] bridge: make bridge-nf-call-*tables default configurable |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
