From f4c8662fabe76838ed01fe4aacc384b331971dd3 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 20 Jun 2003 22:02:14 -0700 Subject: [PATCH] Don't register SCSI devices until they are actually fully set up. 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 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 4fd3f6f55141..a798bdf9c446 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -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; } -- 2.39.5