Commit ebae2604 authored by Andrey Borzenkov's avatar Andrey Borzenkov Committed by Linus Torvalds

PM: Fix pm_notifiers during user mode hibernation

Snapshot device is opened with O_RDONLY during suspend and O_WRONLY durig
resume.  Make sure we also call notifiers with correct parameter telling
them what we are really doing.
Signed-off-by: default avatarAndrey Borzenkov <arvidjaar@mail.ru>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Cc: Len Brown <lenb@kernel.org>
Cc: Greg KH <gregkh@suse.de>
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 0cb57258
...@@ -95,15 +95,15 @@ static int snapshot_open(struct inode *inode, struct file *filp) ...@@ -95,15 +95,15 @@ static int snapshot_open(struct inode *inode, struct file *filp)
data->swap = swsusp_resume_device ? data->swap = swsusp_resume_device ?
swap_type_of(swsusp_resume_device, 0, NULL) : -1; swap_type_of(swsusp_resume_device, 0, NULL) : -1;
data->mode = O_RDONLY; data->mode = O_RDONLY;
error = pm_notifier_call_chain(PM_RESTORE_PREPARE); error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
if (error) if (error)
pm_notifier_call_chain(PM_POST_RESTORE); pm_notifier_call_chain(PM_POST_HIBERNATION);
} else { } else {
data->swap = -1; data->swap = -1;
data->mode = O_WRONLY; data->mode = O_WRONLY;
error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
if (error) if (error)
pm_notifier_call_chain(PM_POST_HIBERNATION); pm_notifier_call_chain(PM_POST_RESTORE);
} }
if (error) if (error)
atomic_inc(&snapshot_device_available); atomic_inc(&snapshot_device_available);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment