Skip to content

Commit

Permalink
Merge branch 'pm-sleep'
Browse files Browse the repository at this point in the history
* pm-sleep:
  PM / Hibernate: Use get_gendisk to verify partition if resume_file is integer format
  • Loading branch information
Rafael J. Wysocki committed May 18, 2012
2 parents 06132ee + 2df83fa commit 0033c15
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Documentation/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2372,6 +2372,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.

resume= [SWSUSP]
Specify the partition device for software suspend
Format:
{/dev/<dev> | PARTUUID=<uuid> | <int>:<int> | <hex>}

resume_offset= [SWSUSP]
Specify the offset from the beginning of the partition
Expand Down
13 changes: 13 additions & 0 deletions kernel/power/hibernate.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <linux/freezer.h>
#include <linux/gfp.h>
#include <linux/syscore_ops.h>
#include <linux/ctype.h>
#include <linux/genhd.h>
#include <scsi/scsi_scan.h>

#include "power.h"
Expand Down Expand Up @@ -722,6 +724,17 @@ static int software_resume(void)

/* Check if the device is there */
swsusp_resume_device = name_to_dev_t(resume_file);

/*
* name_to_dev_t is ineffective to verify parition if resume_file is in
* integer format. (e.g. major:minor)
*/
if (isdigit(resume_file[0]) && resume_wait) {
int partno;
while (!get_gendisk(swsusp_resume_device, &partno))
msleep(10);
}

if (!swsusp_resume_device) {
/*
* Some device discovery might still be in progress; we need
Expand Down

0 comments on commit 0033c15

Please sign in to comment.