public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC/PATCH] PM / Hibernate : Add wait for disk detection if resume_file is MAJOR:MINOR style
@ 2012-05-07  8:26 Minho Ban
  2012-05-07 19:39 ` Rafael J. Wysocki
  2012-05-09  6:12 ` Srivatsa S. Bhat
  0 siblings, 2 replies; 7+ messages in thread
From: Minho Ban @ 2012-05-07  8:26 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Len Brown, Pavel Machek, linux-pm, linux-kernel

name_to_dev_t is not enough to check device detection when the resume_file is
MAJOR:MINOR format. get_gendisk is needed in that case.

Signed-off-by: Minho Ban <mhban@samsung.com>
---
 kernel/power/hibernate.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index e09dfbf..27efaef 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -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"
@@ -749,6 +751,14 @@ static int software_resume(void)
 		}
 	}
 
+	/* name_to_dev_t is ineffective if resume_file comes in major:minor
+	 * format */
+	if (isdigit(resume_file[0]) && resume_wait) {
+		int partno;
+		while (!get_gendisk(swsusp_resume_device, &partno))
+			msleep(10);
+	}
+
  Check_image:
 	pr_debug("PM: Hibernation image partition %d:%d present\n",
 		MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device));
-- 
1.7.5.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-05-09  8:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-07  8:26 [RFC/PATCH] PM / Hibernate : Add wait for disk detection if resume_file is MAJOR:MINOR style Minho Ban
2012-05-07 19:39 ` Rafael J. Wysocki
2012-05-07 23:56   ` Minho Ban
2012-05-08 21:28     ` Rafael J. Wysocki
2012-05-09  8:03       ` Minho Ban
2012-05-09  6:12 ` Srivatsa S. Bhat
2012-05-09  8:03   ` Minho Ban

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox