Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53680
b: refs/heads/master
c: 0979c84
h: refs/heads/master
v: v3
  • Loading branch information
Robert Jennings authored and James Bottomley committed Apr 1, 2007
1 parent e8a4031 commit 1cd8ee8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a897ff2a6386ac4368ba41db18b626afd903f9d8
refs/heads/master: 0979c84b4affaf924a894380dd0069638b64de03
22 changes: 22 additions & 0 deletions trunk/drivers/scsi/ibmvscsi/ibmvscsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1354,6 +1354,27 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata,
return rc;
}

/**
* ibmvscsi_slave_configure: Set the "allow_restart" flag for each disk.
* @sdev: struct scsi_device device to configure
*
* Enable allow_restart for a device if it is a disk. Adjust the
* queue_depth here also as is required by the documentation for
* struct scsi_host_template.
*/
static int ibmvscsi_slave_configure(struct scsi_device *sdev)
{
struct Scsi_Host *shost = sdev->host;
unsigned long lock_flags = 0;

spin_lock_irqsave(shost->host_lock, lock_flags);
if (sdev->type == TYPE_DISK)
sdev->allow_restart = 1;
scsi_adjust_queue_depth(sdev, 0, shost->cmd_per_lun);
spin_unlock_irqrestore(shost->host_lock, lock_flags);
return 0;
}

/* ------------------------------------------------------------
* sysfs attributes
*/
Expand Down Expand Up @@ -1499,6 +1520,7 @@ static struct scsi_host_template driver_template = {
.queuecommand = ibmvscsi_queuecommand,
.eh_abort_handler = ibmvscsi_eh_abort_handler,
.eh_device_reset_handler = ibmvscsi_eh_device_reset_handler,
.slave_configure = ibmvscsi_slave_configure,
.cmd_per_lun = 16,
.can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT,
.this_id = -1,
Expand Down

0 comments on commit 1cd8ee8

Please sign in to comment.