@@ -254,10 +254,12 @@ static inline int notifier_to_errno(int ret)
/* Hibernation and suspend events */
#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
#define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
-#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
-#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_SUSPEND_PREPARE 0x0003 /* Preparing to suspend the system */
+#define PM_DO_SUSPEND 0x0004 /* Going to suspend the system */
+#define PM_DO_RESUME 0x0005 /* Going to resume the system */
+#define PM_POST_SUSPEND 0x0006 /* Suspend finished */
+#define PM_RESTORE_PREPARE 0x0007 /* Going to restore a saved image */
+#define PM_POST_RESTORE 0x0008 /* Restore failed */
/* Console keyboard events.
* Note: KBD_KEYCODE is always sent before KBD_UNBOUND_KEYCODE, KBD_UNICODE and
@@ -224,9 +224,14 @@ int suspend_devices_and_enter(suspend_state_t state)
if (suspend_test(TEST_DEVICES))
goto Recover_platform;
+ error = pm_notifier_call_chain(PM_DO_SUSPEND);
+ if (error)
+ goto Recover_platform;
+
suspend_enter(state);
Resume_devices:
+ pm_notifier_call_chain(PM_DO_RESUME);
suspend_test_start();
dpm_resume_end(PMSG_RESUME);
suspend_test_finish("resume devices");