Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0979c84b4affaf924a894380dd0069638b64de03
Commit:     0979c84b4affaf924a894380dd0069638b64de03
Parent:     a897ff2a6386ac4368ba41db18b626afd903f9d8
Author:     Robert Jennings <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 29 12:30:40 2007 -0500
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Sun Apr 1 10:37:02 2007 -0500

    [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" <[EMAIL PROTECTED]>
    Signed-off-by: "Santiago Leon" <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 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 383f594..b10eefe 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,
        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
  */
@@ -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,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to