diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-04-12 14:06:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-13 14:37:07 -0400 |
commit | c751085943362143f84346d274e0011419c84202 (patch) | |
tree | 5323da4e3eba8126bf44e5107960ee2323d28a16 /kernel/power/disk.c | |
parent | 7b11428d37fe65643172feff66cd0a4d72d1932a (diff) |
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 <rjw@sisk.pl>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/power/disk.c')
-rw-r--r-- | kernel/power/disk.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 5f21ab2bbcdf..0854770b63b9 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/console.h> | 22 | #include <linux/console.h> |
23 | #include <linux/cpu.h> | 23 | #include <linux/cpu.h> |
24 | #include <linux/freezer.h> | 24 | #include <linux/freezer.h> |
25 | #include <scsi/scsi_scan.h> | ||
25 | #include <asm/suspend.h> | 26 | #include <asm/suspend.h> |
26 | 27 | ||
27 | #include "power.h" | 28 | #include "power.h" |
@@ -645,6 +646,13 @@ static int software_resume(void) | |||
645 | return 0; | 646 | return 0; |
646 | 647 | ||
647 | /* | 648 | /* |
649 | * We can't depend on SCSI devices being available after loading one of | ||
650 | * their modules if scsi_complete_async_scans() is not called and the | ||
651 | * resume device usually is a SCSI one. | ||
652 | */ | ||
653 | scsi_complete_async_scans(); | ||
654 | |||
655 | /* | ||
648 | * name_to_dev_t() below takes a sysfs buffer mutex when sysfs | 656 | * name_to_dev_t() below takes a sysfs buffer mutex when sysfs |
649 | * is configured into the kernel. Since the regular hibernate | 657 | * is configured into the kernel. Since the regular hibernate |
650 | * trigger path is via sysfs which takes a buffer mutex before | 658 | * trigger path is via sysfs which takes a buffer mutex before |