]> git.neil.brown.name Git - history.git/commitdiff
Don't register SCSI devices until they are actually fully set up.
authorLinus Torvalds <torvalds@home.transmeta.com>
Sat, 21 Jun 2003 05:02:14 +0000 (22:02 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 21 Jun 2003 05:02:14 +0000 (22:02 -0700)
Also, default to the 10-byte version of mode sense, since a lot
of modern SCSI-like devices don't even support the old version
(we will automatically downgrade to the 6-byte version if the long
version isn't supported).

drivers/scsi/scsi_scan.c

index 4fd3f6f55141b51259216914d9456612c0cd8f65..a798bdf9c446d2a675855a7d95ec4c5349718873 100644 (file)
@@ -583,8 +583,6 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
                                sdev->host->host_no, sdev->channel,
                                sdev->id, sdev->lun);
 
-       scsi_device_register(sdev);
-
        /*
         * End driverfs/devfs code.
         */
@@ -647,11 +645,18 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags)
        sdev->max_device_blocked = SCSI_DEFAULT_DEVICE_BLOCKED;
 
        sdev->use_10_for_rw = 1;
-       sdev->use_10_for_ms = 0;
+       sdev->use_10_for_ms = 1;
 
        if(sdev->host->hostt->slave_configure)
                sdev->host->hostt->slave_configure(sdev);
 
+       /*
+        * Ok, the device is now all set up, we can
+        * register it and tell the rest of the kernel
+        * about it.
+        */
+       scsi_device_register(sdev);
+
        return SCSI_SCAN_LUN_PRESENT;
 }