Skip to content

Commit

Permalink
PM / Hibernate: Fix ioctl SNAPSHOT_S2RAM
Browse files Browse the repository at this point in the history
The SNAPSHOT_S2RAM ioctl used for implementing the feature allowing
one to suspend to RAM after creating a hibernation image is currently
broken, because it doesn't clear the "ready" flag in the struct
snapshot_data object handled by it.  As a result, the
SNAPSHOT_UNFREEZE doesn't work correctly after SNAPSHOT_S2RAM has
returned and the user space hibernate task cannot thaw the other
processes as appropriate.  Make SNAPSHOT_S2RAM clear data->ready
to fix this problem.

Tested-by: Alexandre Felipe Muller de Souza <alexandrefm@mandriva.com.br>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: stable@kernel.org
  • Loading branch information
Rafael J. Wysocki committed May 11, 2011
1 parent 9744997 commit 36cb703
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/power/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
* PM_HIBERNATION_PREPARE
*/
error = suspend_devices_and_enter(PM_SUSPEND_MEM);
data->ready = 0;
break;

case SNAPSHOT_PLATFORM_SUPPORT:
Expand Down

0 comments on commit 36cb703

Please sign in to comment.