]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/scsi/scsi_scan.c
parisc: sba_iommu: fix build bug when CONFIG_PARISC_AGP=y
[mv-sheeva.git] / drivers / scsi / scsi_scan.c
index f8493f219bc98ea7749a71ab6d5f90bf8fc8ebbe..8f4de20c9deb061266b41f18866931523e93241a 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/delay.h>
 #include <linux/kthread.h>
 #include <linux/spinlock.h>
+#include <linux/async.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
@@ -179,6 +180,8 @@ int scsi_complete_async_scans(void)
        spin_unlock(&async_scan_lock);
 
        kfree(data);
+       /* Synchronize async operations globally */
+       async_synchronize_full();
        return 0;
 }
 
@@ -314,6 +317,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
        return sdev;
 
 out_device_destroy:
+       scsi_device_set_state(sdev, SDEV_DEL);
        transport_destroy_device(&sdev->sdev_gendev);
        put_device(&sdev->sdev_gendev);
 out: