diff options
author | Robert Jennings <rcj@linux.vnet.ibm.com> | 2007-03-29 13:30:40 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2007-04-01 11:37:02 -0400 |
commit | 0979c84b4affaf924a894380dd0069638b64de03 (patch) | |
tree | 45810a42af66614a4cb0ba80ba2290396a58227f /drivers/scsi | |
parent | a897ff2a6386ac4368ba41db18b626afd903f9d8 (diff) |
[SCSI] ibmvscsi: add slave_configure to allow device restart
Fixed the kernel-doc comment for ibmvscsi_slave_configure. Thanks to
Randy Dunlap for pointing this out.
Adding a slave_configure function for the driver. Now the disks can be
restarted by the scsi mid-layer when the are disconnected and reconnected.
Signed-off-by: "Robert Jennings" <rcj@linux.vnet.ibm.com>
Signed-off-by: "Santiago Leon" <santil@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-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, |