aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMinho Ban <mhban@samsung.com>2012-05-14 15:45:31 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-18 14:44:59 -0400
commit2df83fa4bce421f8176932142f1004adfba0f9dd (patch)
treeedd5051c5b388e82d8954ec09643873be9bc414c
parent4e585d25e120f1eae0a3a8bf8f6ebc7692afec18 (diff)
PM / Hibernate: Use get_gendisk to verify partition if resume_file is integer format
Sometimes resume= parameter comes in integer style (e.g. major:minor) and then name_to_dev_t can not detect partition properly. (especially async device like usb, mmc). This patch calls get_gendisk() if resumewait is true and resume_file is in integer format to work around this problem. Signed-off-by: Minho Ban <mhban@samsung.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
-rw-r--r--Documentation/kernel-parameters.txt2
-rw-r--r--kernel/power/hibernate.c13
2 files changed, 15 insertions, 0 deletions
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index c1601e5a8b7..5900b49323c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -2372,6 +2372,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
2372 2372
2373 resume= [SWSUSP] 2373 resume= [SWSUSP]
2374 Specify the partition device for software suspend 2374 Specify the partition device for software suspend
2375 Format:
2376 {/dev/<dev> | PARTUUID=<uuid> | <int>:<int> | <hex>}
2375 2377
2376 resume_offset= [SWSUSP] 2378 resume_offset= [SWSUSP]
2377 Specify the offset from the beginning of the partition 2379 Specify the offset from the beginning of the partition
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index e09dfbfeece..8b53db38a27 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -25,6 +25,8 @@
25#include <linux/freezer.h> 25#include <linux/freezer.h>
26#include <linux/gfp.h> 26#include <linux/gfp.h>
27#include <linux/syscore_ops.h> 27#include <linux/syscore_ops.h>
28#include <linux/ctype.h>
29#include <linux/genhd.h>
28#include <scsi/scsi_scan.h> 30#include <scsi/scsi_scan.h>
29 31
30#include "power.h" 32#include "power.h"
@@ -722,6 +724,17 @@ static int software_resume(void)
722 724
723 /* Check if the device is there */ 725 /* Check if the device is there */
724 swsusp_resume_device = name_to_dev_t(resume_file); 726 swsusp_resume_device = name_to_dev_t(resume_file);
727
728 /*
729 * name_to_dev_t is ineffective to verify parition if resume_file is in
730 * integer format. (e.g. major:minor)
731 */
732 if (isdigit(resume_file[0]) && resume_wait) {
733 int partno;
734 while (!get_gendisk(swsusp_resume_device, &partno))
735 msleep(10);
736 }
737
725 if (!swsusp_resume_device) { 738 if (!swsusp_resume_device) {
726 /* 739 /*
727 * Some device discovery might still be in progress; we need 740 * Some device discovery might still be in progress; we need