PM/Hibernate: Wait for SCSI devices scan to complete during resume

There is a race between resume from hibernation and the asynchronous
scanning of SCSI devices and to prevent it from happening we need to
call scsi_complete_async_scans() during resume from hibernation.

In addition, if the resume from hibernation is userland-driven, it's
better to wait for all device probes in the kernel to complete before
attempting to open the resume device.

Signed-off-by: Rafael J. Wysocki <[email protected]>
Acked-by: Arjan van de Ven <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Rafael J. Wysocki 2009-04-12 20:06:56 +02:00 • committed by Linus Torvalds
commit c751085943
5 changed files with 29 additions and 4 deletions

View file

@ -38,9 +38,6 @@ static inline void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
{ };
#endif
/* scsi_scan.c */
int scsi_complete_async_scans(void);
/* scsi_devinfo.c */
extern int scsi_get_device_flags(struct scsi_device *sdev,
const unsigned char *vendor,

View file

@ -11,7 +11,7 @@
*/
#include <linux/module.h>
#include "scsi_priv.h"
#include <scsi/scsi_scan.h>
static int __init wait_scan_init(void)
{