]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fix powermac suspend-to-disk
authorChris Wright <chrisw@sous-sol.org>
Tue, 30 May 2006 18:53:13 +0000 (11:53 -0700)
committerChris Wright <chrisw@sous-sol.org>
Tue, 30 May 2006 18:53:13 +0000 (11:53 -0700)
queue-2.6.16/powermac-force-only-suspend-to-disk-to-be-valid.patch [new file with mode: 0644]
queue-2.6.16/series

diff --git a/queue-2.6.16/powermac-force-only-suspend-to-disk-to-be-valid.patch b/queue-2.6.16/powermac-force-only-suspend-to-disk-to-be-valid.patch
new file mode 100644 (file)
index 0000000..a01f422
--- /dev/null
@@ -0,0 +1,53 @@
+From stable-bounces@linux.kernel.org  Thu May 25 18:48:58 2006
+Date: Thu, 25 May 2006 18:44:24 -0700
+From: akpm@osdl.org
+To: torvalds@osdl.org
+Cc: benh@kernel.crashing.org, johannes@sipsolutions.net, stable@kernel.org
+Subject: PowerMac: force only suspend-to-disk to be valid
+
+From: Johannes Berg <johannes@sipsolutions.net>
+
+For a very long time, echoing 'standby' or 'mem' into /sys/power/state has
+killed the machine on powerpc.  This patch fixes that.
+
+This patch adds the .valid callback to pm_ops on PowerMac so that only the
+suspend to disk state can be entered.  Note that just returning 0 would
+suffice since the upper layers don't pass PM_SUSPEND_DISK down, but we
+handle it there regardless just in case that changes.
+
+Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
+Cc: <stable@kernel.org>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+
+ arch/powerpc/platforms/powermac/setup.c |   12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+--- linux-2.6.16.18.orig/arch/powerpc/platforms/powermac/setup.c
++++ linux-2.6.16.18/arch/powerpc/platforms/powermac/setup.c
+@@ -456,11 +456,23 @@ static int pmac_pm_finish(suspend_state_
+       return 0;
+ }
++static int pmac_pm_valid(suspend_state_t state)
++{
++      switch (state) {
++      case PM_SUSPEND_DISK:
++              return 1;
++      /* can't do any other states via generic mechanism yet */
++      default:
++              return 0;
++      }
++}
++
+ static struct pm_ops pmac_pm_ops = {
+       .pm_disk_mode   = PM_DISK_SHUTDOWN,
+       .prepare        = pmac_pm_prepare,
+       .enter          = pmac_pm_enter,
+       .finish         = pmac_pm_finish,
++      .valid          = pmac_pm_valid,
+ };
+ #endif /* CONFIG_SOFTWARE_SUSPEND */
index 1e4f67d1b381fb0f7a0fcb43138157541f9ca996..c0e75dc1af25491925c91d27681b49e2c0c438c9 100644 (file)
@@ -1,3 +1,4 @@
 altix-correct-ioc4-port-order.patch
 altix-correct-ioc3-port-order.patch
 cpuset-might-sleep-checking-zones-allowed-fix.patch
+powermac-force-only-suspend-to-disk-to-be-valid.patch