public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* RFC: additional event for pm_notifier
@ 2010-03-17 18:56 Sebastian Ott
  2010-03-17 21:34 ` Rafael J. Wysocki
  0 siblings, 1 reply; 11+ messages in thread
From: Sebastian Ott @ 2010-03-17 18:56 UTC (permalink / raw)
  To: Rafael J. Wysocki, Pavel Machek; +Cc: linux-pm

hi,

on s390 certain hw features which we normally enable in our init
calls, get reset while restoring the hibernation image.
so we need a trigger to reenable them before the device callbacks
are called.

is it possible to add an additional event for the existing
pm_notifier (something like the attached patch)?

regards
sebastian


Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
---
 include/linux/notifier.h |    1 +
 kernel/power/hibernate.c |    2 ++
 2 files changed, 3 insertions(+)

Index: linux-2.6/include/linux/notifier.h
===================================================================
--- linux-2.6.orig/include/linux/notifier.h
+++ linux-2.6/include/linux/notifier.h
@@ -250,6 +250,8 @@ static inline int notifier_to_errno(int 
 #define PM_POST_SUSPEND		0x0004 /* Suspend finished */
 #define PM_RESTORE_PREPARE	0x0005 /* Going to restore a saved image */
 #define PM_POST_RESTORE		0x0006 /* Restore failed */
+#define PM_RESTORE_FINISHED	0x0007 /* Image restored, called prior to
+					  device callbacks */
 
 /* Console keyboard events.
  * Note: KBD_KEYCODE is always sent before KBD_UNBOUND_KEYCODE, KBD_UNICODE and
Index: linux-2.6/kernel/power/hibernate.c
===================================================================
--- linux-2.6.orig/kernel/power/hibernate.c
+++ linux-2.6/kernel/power/hibernate.c
@@ -290,6 +290,8 @@ static int create_image(int platform_mod
 	if (!in_suspend)
 		platform_leave(platform_mode);
 
+	pm_notifier_call_chain(PM_RESTORE_FINISHED);
+
  Power_up:
 	sysdev_resume();
 	/* NOTE:  dpm_resume_noirq() is just a resume() for devices

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-03-31 20:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-17 18:56 RFC: additional event for pm_notifier Sebastian Ott
2010-03-17 21:34 ` Rafael J. Wysocki
2010-03-18  9:13   ` Sebastian Ott
2010-03-18 11:37   ` Sebastian Ott
2010-03-18 20:19     ` Rafael J. Wysocki
2010-03-18 20:58       ` Rafael J. Wysocki
2010-03-19  8:40         ` Sebastian Ott
2010-03-26 19:25       ` Sebastian Ott
2010-03-26 21:31         ` Rafael J. Wysocki
2010-03-31 11:39           ` Sebastian Ott
2010-03-31 20:33             ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox