mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									4e585d25e1
								
							
						
					
					
						commit
						2df83fa4bc
					
				
					 2 changed files with 15 additions and 0 deletions
				
			
		| 
						 | 
					@ -2372,6 +2372,8 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	resume=		[SWSUSP]
 | 
						resume=		[SWSUSP]
 | 
				
			||||||
			Specify the partition device for software suspend
 | 
								Specify the partition device for software suspend
 | 
				
			||||||
 | 
								Format:
 | 
				
			||||||
 | 
								{/dev/<dev> | PARTUUID=<uuid> | <int>:<int> | <hex>}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	resume_offset=	[SWSUSP]
 | 
						resume_offset=	[SWSUSP]
 | 
				
			||||||
			Specify the offset from the beginning of the partition
 | 
								Specify the offset from the beginning of the partition
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -25,6 +25,8 @@
 | 
				
			||||||
#include <linux/freezer.h>
 | 
					#include <linux/freezer.h>
 | 
				
			||||||
#include <linux/gfp.h>
 | 
					#include <linux/gfp.h>
 | 
				
			||||||
#include <linux/syscore_ops.h>
 | 
					#include <linux/syscore_ops.h>
 | 
				
			||||||
 | 
					#include <linux/ctype.h>
 | 
				
			||||||
 | 
					#include <linux/genhd.h>
 | 
				
			||||||
#include <scsi/scsi_scan.h>
 | 
					#include <scsi/scsi_scan.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "power.h"
 | 
					#include "power.h"
 | 
				
			||||||
| 
						 | 
					@ -722,6 +724,17 @@ static int software_resume(void)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Check if the device is there */
 | 
						/* Check if the device is there */
 | 
				
			||||||
	swsusp_resume_device = name_to_dev_t(resume_file);
 | 
						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) {
 | 
						if (!swsusp_resume_device) {
 | 
				
			||||||
		/*
 | 
							/*
 | 
				
			||||||
		 * Some device discovery might still be in progress; we need
 | 
							 * Some device discovery might still be in progress; we need
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue