diff options
Diffstat (limited to 'drivers/scsi/scsi_scan.c')
-rw-r--r-- | drivers/scsi/scsi_scan.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 47291bcff0d5..38518b088073 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/kthread.h> | 33 | #include <linux/kthread.h> |
34 | #include <linux/spinlock.h> | 34 | #include <linux/spinlock.h> |
35 | #include <linux/async.h> | 35 | #include <linux/async.h> |
36 | #include <linux/slab.h> | ||
36 | 37 | ||
37 | #include <scsi/scsi.h> | 38 | #include <scsi/scsi.h> |
38 | #include <scsi/scsi_cmnd.h> | 39 | #include <scsi/scsi_cmnd.h> |
@@ -251,6 +252,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget, | |||
251 | sdev->model = scsi_null_device_strs; | 252 | sdev->model = scsi_null_device_strs; |
252 | sdev->rev = scsi_null_device_strs; | 253 | sdev->rev = scsi_null_device_strs; |
253 | sdev->host = shost; | 254 | sdev->host = shost; |
255 | sdev->queue_ramp_up_period = SCSI_DEFAULT_RAMP_UP_PERIOD; | ||
254 | sdev->id = starget->id; | 256 | sdev->id = starget->id; |
255 | sdev->lun = lun; | 257 | sdev->lun = lun; |
256 | sdev->channel = starget->channel; | 258 | sdev->channel = starget->channel; |
@@ -878,7 +880,7 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, | |||
878 | * broken RA4x00 Compaq Disk Array | 880 | * broken RA4x00 Compaq Disk Array |
879 | */ | 881 | */ |
880 | if (*bflags & BLIST_MAX_512) | 882 | if (*bflags & BLIST_MAX_512) |
881 | blk_queue_max_sectors(sdev->request_queue, 512); | 883 | blk_queue_max_hw_sectors(sdev->request_queue, 512); |
882 | 884 | ||
883 | /* | 885 | /* |
884 | * Some devices may not want to have a start command automatically | 886 | * Some devices may not want to have a start command automatically |
@@ -941,6 +943,8 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result, | |||
941 | } | 943 | } |
942 | } | 944 | } |
943 | 945 | ||
946 | sdev->max_queue_depth = sdev->queue_depth; | ||
947 | |||
944 | /* | 948 | /* |
945 | * Ok, the device is now all set up, we can | 949 | * Ok, the device is now all set up, we can |
946 | * register it and tell the rest of the kernel | 950 | * register it and tell the rest of the kernel |
@@ -1336,8 +1340,10 @@ static int scsi_report_lun_scan(struct scsi_target *starget, int bflags, | |||
1336 | sdev = scsi_alloc_sdev(starget, 0, NULL); | 1340 | sdev = scsi_alloc_sdev(starget, 0, NULL); |
1337 | if (!sdev) | 1341 | if (!sdev) |
1338 | return 0; | 1342 | return 0; |
1339 | if (scsi_device_get(sdev)) | 1343 | if (scsi_device_get(sdev)) { |
1344 | __scsi_remove_device(sdev); | ||
1340 | return 0; | 1345 | return 0; |
1346 | } | ||
1341 | } | 1347 | } |
1342 | 1348 | ||
1343 | sprintf(devname, "host %d channel %d id %d", | 1349 | sprintf(devname, "host %d channel %d id %d", |
@@ -1904,10 +1910,9 @@ struct scsi_device *scsi_get_host_dev(struct Scsi_Host *shost) | |||
1904 | goto out; | 1910 | goto out; |
1905 | 1911 | ||
1906 | sdev = scsi_alloc_sdev(starget, 0, NULL); | 1912 | sdev = scsi_alloc_sdev(starget, 0, NULL); |
1907 | if (sdev) { | 1913 | if (sdev) |
1908 | sdev->sdev_gendev.parent = get_device(&starget->dev); | ||
1909 | sdev->borken = 0; | 1914 | sdev->borken = 0; |
1910 | } else | 1915 | else |
1911 | scsi_target_reap(starget); | 1916 | scsi_target_reap(starget); |
1912 | put_device(&starget->dev); | 1917 | put_device(&starget->dev); |
1913 | out: | 1918 | out: |