aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/dd.c1
-rw-r--r--drivers/scsi/scsi_scan.c2
-rw-r--r--drivers/scsi/scsi_wait_scan.c11
-rw-r--r--include/linux/device.h1
4 files changed, 13 insertions, 2 deletions
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index f17c3266a0e0..742cbe6b042b 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -179,6 +179,7 @@ void wait_for_device_probe(void)
179 wait_event(probe_waitqueue, atomic_read(&probe_count) == 0); 179 wait_event(probe_waitqueue, atomic_read(&probe_count) == 0);
180 async_synchronize_full(); 180 async_synchronize_full();
181} 181}
182EXPORT_SYMBOL_GPL(wait_for_device_probe);
182 183
183/** 184/**
184 * driver_probe_device - attempt to bind device & driver together 185 * driver_probe_device - attempt to bind device & driver together
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index a14d245a66b8..6f51ca485f35 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -180,8 +180,6 @@ int scsi_complete_async_scans(void)
180 spin_unlock(&async_scan_lock); 180 spin_unlock(&async_scan_lock);
181 181
182 kfree(data); 182 kfree(data);
183 /* Synchronize async operations globally */
184 async_synchronize_full();
185 return 0; 183 return 0;
186} 184}
187 185
diff --git a/drivers/scsi/scsi_wait_scan.c b/drivers/scsi/scsi_wait_scan.c
index 2f21af21269a..74708fcaf82f 100644
--- a/drivers/scsi/scsi_wait_scan.c
+++ b/drivers/scsi/scsi_wait_scan.c
@@ -11,10 +11,21 @@
11 */ 11 */
12 12
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/device.h>
14#include <scsi/scsi_scan.h> 15#include <scsi/scsi_scan.h>
15 16
16static int __init wait_scan_init(void) 17static int __init wait_scan_init(void)
17{ 18{
19 /*
20 * First we need to wait for device probing to finish;
21 * the drivers we just loaded might just still be probing
22 * and might not yet have reached the scsi async scanning
23 */
24 wait_for_device_probe();
25 /*
26 * and then we wait for the actual asynchronous scsi scan
27 * to finish.
28 */
18 scsi_complete_async_scans(); 29 scsi_complete_async_scans();
19 return 0; 30 return 0;
20} 31}
diff --git a/include/linux/device.h b/include/linux/device.h
index 2918c0e8fdfd..6a69caaac18a 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -551,6 +551,7 @@ extern int (*platform_notify_remove)(struct device *dev);
551extern struct device *get_device(struct device *dev); 551extern struct device *get_device(struct device *dev);
552extern void put_device(struct device *dev); 552extern void put_device(struct device *dev);
553 553
554extern void wait_for_device_probe(void);
554 555
555/* drivers/base/power/shutdown.c */ 556/* drivers/base/power/shutdown.c */
556extern void device_shutdown(void); 557extern void device_shutdown(void);