[SCSI] ibmvfc: do not reset dev_loss_tmo in slave callout
authorMike Christie <michaelc@cs.wisc.edu>
Fri, 6 Aug 2010 08:02:41 +0000 (03:02 -0500)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 5 Sep 2010 16:45:29 +0000 (13:45 -0300)
This fixes a bug where the driver was resetting the
rport dev_loss_tmo when devices were added by adding
support for the get_host_def_dev_loss_tmo callout.

Patch has only been compile tested.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/ibmvscsi/ibmvfc.c

index 9f75a6d..a5dd9b4 100644 (file)
@@ -1030,6 +1030,11 @@ static void ibmvfc_get_host_port_state(struct Scsi_Host *shost)
        spin_unlock_irqrestore(shost->host_lock, flags);
 }
 
+static void ibmvfc_set_host_def_dev_loss_tmo(struct Scsi_Host *shost)
+{
+       fc_host_def_dev_loss_tmo(shost) = dev_loss_tmo;
+}
+
 /**
  * ibmvfc_set_rport_dev_loss_tmo - Set rport's device loss timeout
  * @rport:             rport struct
@@ -2788,7 +2793,6 @@ static int ibmvfc_target_alloc(struct scsi_target *starget)
 static int ibmvfc_slave_configure(struct scsi_device *sdev)
 {
        struct Scsi_Host *shost = sdev->host;
-       struct fc_rport *rport = starget_to_rport(sdev->sdev_target);
        unsigned long flags = 0;
 
        spin_lock_irqsave(shost->host_lock, flags);
@@ -2800,8 +2804,6 @@ static int ibmvfc_slave_configure(struct scsi_device *sdev)
                scsi_activate_tcq(sdev, sdev->queue_depth);
        } else
                scsi_deactivate_tcq(sdev, sdev->queue_depth);
-
-       rport->dev_loss_tmo = dev_loss_tmo;
        spin_unlock_irqrestore(shost->host_lock, flags);
        return 0;
 }
@@ -4889,6 +4891,8 @@ static struct fc_function_template ibmvfc_transport_functions = {
        .get_host_speed = ibmvfc_get_host_speed,
        .show_host_speed = 1,
 
+       .get_host_def_dev_loss_tmo = ibmvfc_set_host_def_dev_loss_tmo,
+
        .issue_fc_host_lip = ibmvfc_issue_fc_host_lip,
        .terminate_rport_io = ibmvfc_terminate_rport_io,