From 61d4dcfcb70c0dafbf256f3239f8da5ba5c3dcbb Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Tue, 21 Apr 2009 13:32:54 -0700 Subject: [PATCH] --- yaml --- r: 143827 b: refs/heads/master c: d4d5291c8cd499b1b590336059d5cc3e24c1ced6 h: refs/heads/master i: 143825: 5c1f12ae1ddc5510d60e7f1747833033ebfb4279 143823: cf5f7df5e9ec95e0607e3ff6bdf848d0ed390101 v: v3 --- [refs] | 2 +- trunk/drivers/base/dd.c | 1 + trunk/drivers/scsi/scsi_scan.c | 2 -- trunk/drivers/scsi/scsi_wait_scan.c | 11 +++++++++++ trunk/include/linux/device.h | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index abe65a0292fa..204b2308232b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5dd559f020c98a2a4b3e063f09c0e4bc771ed838 +refs/heads/master: d4d5291c8cd499b1b590336059d5cc3e24c1ced6 diff --git a/trunk/drivers/base/dd.c b/trunk/drivers/base/dd.c index f17c3266a0e0..742cbe6b042b 100644 --- a/trunk/drivers/base/dd.c +++ b/trunk/drivers/base/dd.c @@ -179,6 +179,7 @@ void wait_for_device_probe(void) wait_event(probe_waitqueue, atomic_read(&probe_count) == 0); async_synchronize_full(); } +EXPORT_SYMBOL_GPL(wait_for_device_probe); /** * driver_probe_device - attempt to bind device & driver together diff --git a/trunk/drivers/scsi/scsi_scan.c b/trunk/drivers/scsi/scsi_scan.c index a14d245a66b8..6f51ca485f35 100644 --- a/trunk/drivers/scsi/scsi_scan.c +++ b/trunk/drivers/scsi/scsi_scan.c @@ -180,8 +180,6 @@ int scsi_complete_async_scans(void) spin_unlock(&async_scan_lock); kfree(data); - /* Synchronize async operations globally */ - async_synchronize_full(); return 0; } diff --git a/trunk/drivers/scsi/scsi_wait_scan.c b/trunk/drivers/scsi/scsi_wait_scan.c index 2f21af21269a..74708fcaf82f 100644 --- a/trunk/drivers/scsi/scsi_wait_scan.c +++ b/trunk/drivers/scsi/scsi_wait_scan.c @@ -11,10 +11,21 @@ */ #include +#include #include static int __init wait_scan_init(void) { + /* + * First we need to wait for device probing to finish; + * the drivers we just loaded might just still be probing + * and might not yet have reached the scsi async scanning + */ + wait_for_device_probe(); + /* + * and then we wait for the actual asynchronous scsi scan + * to finish. + */ scsi_complete_async_scans(); return 0; } diff --git a/trunk/include/linux/device.h b/trunk/include/linux/device.h index 2918c0e8fdfd..6a69caaac18a 100644 --- a/trunk/include/linux/device.h +++ b/trunk/include/linux/device.h @@ -551,6 +551,7 @@ extern int (*platform_notify_remove)(struct device *dev); extern struct device *get_device(struct device *dev); extern void put_device(struct device *dev); +extern void wait_for_device_probe(void); /* drivers/base/power/shutdown.c */ extern void device_shutdown(void);