diff options
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 383f5948ba06..b10eefe735c5 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -1354,6 +1354,27 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata, | |||
1354 | return rc; | 1354 | return rc; |
1355 | } | 1355 | } |
1356 | 1356 | ||
1357 | /** | ||
1358 | * ibmvscsi_slave_configure: Set the "allow_restart" flag for each disk. | ||
1359 | * @sdev: struct scsi_device device to configure | ||
1360 | * | ||
1361 | * Enable allow_restart for a device if it is a disk. Adjust the | ||
1362 | * queue_depth here also as is required by the documentation for | ||
1363 | * struct scsi_host_template. | ||
1364 | */ | ||
1365 | static int ibmvscsi_slave_configure(struct scsi_device *sdev) | ||
1366 | { | ||
1367 | struct Scsi_Host *shost = sdev->host; | ||
1368 | unsigned long lock_flags = 0; | ||
1369 | |||
1370 | spin_lock_irqsave(shost->host_lock, lock_flags); | ||
1371 | if (sdev->type == TYPE_DISK) | ||
1372 | sdev->allow_restart = 1; | ||
1373 | scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun); | ||
1374 | spin_unlock_irqrestore(shost->host_lock, lock_flags); | ||
1375 | return 0; | ||
1376 | } | ||
1377 | |||
1357 | /* ------------------------------------------------------------ | 1378 | /* ------------------------------------------------------------ |
1358 | * sysfs attributes | 1379 | * sysfs attributes |
1359 | */ | 1380 | */ |
@@ -1499,6 +1520,7 @@ static struct scsi_host_template driver_template = { | |||
1499 | .queuecommand = ibmvscsi_queuecommand, | 1520 | .queuecommand = ibmvscsi_queuecommand, |
1500 | .eh_abort_handler = ibmvscsi_eh_abort_handler, | 1521 | .eh_abort_handler = ibmvscsi_eh_abort_handler, |
1501 | .eh_device_reset_handler = ibmvscsi_eh_device_reset_handler, | 1522 | .eh_device_reset_handler = ibmvscsi_eh_device_reset_handler, |
1523 | .slave_configure = ibmvscsi_slave_configure, | ||
1502 | .cmd_per_lun = 16, | 1524 | .cmd_per_lun = 16, |
1503 | .can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT, | 1525 | .can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT, |
1504 | .this_id = -1, | 1526 | .this_id = -1, |